Revision 4235de9b
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/magic/RubikDialogMain.java | ||
---|---|---|
20 | 20 |
package org.distorted.magic; |
21 | 21 |
|
22 | 22 |
import android.app.Dialog; |
23 |
import android.content.DialogInterface; |
|
24 | 23 |
import android.os.Bundle; |
25 | 24 |
import android.support.annotation.NonNull; |
26 | 25 |
import android.support.v4.app.FragmentActivity; |
... | ... | |
28 | 27 |
import android.support.v7.app.AppCompatDialogFragment; |
29 | 28 |
import android.view.LayoutInflater; |
30 | 29 |
import android.view.View; |
30 |
import android.view.Window; |
|
31 |
import android.view.WindowManager; |
|
31 | 32 |
|
32 | 33 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
33 | 34 |
|
34 | 35 |
public class RubikDialogMain extends AppCompatDialogFragment |
35 | 36 |
{ |
37 |
@Override |
|
38 |
public void onStart() |
|
39 |
{ |
|
40 |
super.onStart(); |
|
41 |
|
|
42 |
Window window = getDialog().getWindow(); |
|
43 |
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, |
|
44 |
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL); |
|
45 |
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); |
|
46 |
} |
|
47 |
|
|
48 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
49 |
|
|
36 | 50 |
@NonNull |
37 | 51 |
@Override |
38 | 52 |
public Dialog onCreateDialog(Bundle savedInstanceState) |
39 | 53 |
{ |
40 | 54 |
FragmentActivity act = getActivity(); |
41 | 55 |
AlertDialog.Builder builder = new AlertDialog.Builder(act); |
42 |
|
|
43 |
builder.setTitle(R.string.app_version); |
|
44 |
builder.setIcon(R.drawable.button3); |
|
45 |
builder.setCancelable(false); |
|
46 |
builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener() |
|
47 |
{ |
|
48 |
@Override |
|
49 |
public void onClick(DialogInterface dialog, int which) |
|
50 |
{ |
|
51 |
|
|
52 |
} |
|
53 |
}); |
|
54 |
|
|
55 | 56 |
LayoutInflater inflater = act.getLayoutInflater(); |
56 |
final View view = inflater.inflate(R.layout.dialog_about, null);
|
|
57 |
final View view = inflater.inflate(R.layout.dialog_main, null);
|
|
57 | 58 |
builder.setView(view); |
58 | 59 |
|
59 | 60 |
return builder.create(); |
60 | 61 |
} |
61 |
} |
|
62 |
} |
Also available in: Unified diff
Major rearrangement of the UI.