Skip to content

Instantly share code, notes, and snippets.

@daichan4649
Last active February 24, 2019 11:20
Show Gist options
  • Save daichan4649/5344979 to your computer and use it in GitHub Desktop.
Save daichan4649/5344979 to your computer and use it in GitHub Desktop.
Full screen ProgressDialog (for Android)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
class ProgressDialogFragment extends DialogFragment {
public static ProgressDialogFragment newInstance() {
return new ProgressDialogFragment();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NO_FRAME, android.R.style.Theme_Translucent);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_dialog_progress, container, false);
}
}
@daichan4649
Copy link
Author

処理中ダイアログ

  • 全画面
  • 透明

@topex-psy
Copy link

any usage example in activity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment