Skip to content

Instantly share code, notes, and snippets.

@jie-meng
Last active October 11, 2017 14:55
Show Gist options
  • Save jie-meng/0742c44dbd6bedec1d1caa11dc7eede7 to your computer and use it in GitHub Desktop.
Save jie-meng/0742c44dbd6bedec1d1caa11dc7eede7 to your computer and use it in GitHub Desktop.
createProgressView
public static View createProgressView(Activity activity) {
ViewGroup viewGroup = (ViewGroup) activity.findViewById(android.R.id.content);
View progressView = LayoutInflater.from(activity).inflate(R.layout.view_progress_bar, viewGroup, false);
viewGroup.addView(progressView);
return progressView;
}
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment