Search This Blog

Showing posts with label Hệ Thống. Show all posts
Showing posts with label Hệ Thống. Show all posts

Friday, July 28, 2017

Tuy chinh theme

manifesh.xml : 

<activity    android:name=".TrangChu.TrangChinh"    android:hardwareAccelerated="true"    android:label="@string/app_name"    android:theme="@style/AppTheme.NoActionBar1"></activity>


<style name="AppTheme.NoActionBar1" >

    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@color/colorPrimaryDark</item>

    <item name="android:windowContentTransitions">true</item>
    <item name="android:windowAllowEnterTransitionOverlap">true</item>
    <item name="android:windowAllowReturnTransitionOverlap">true</item>
    <item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
    <item name="android:windowSharedElementExitTransition">@android:transition/move</item>
</style>


Wednesday, July 5, 2017

Chuyển đến màn hình mở ghi hệ thống

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                if (Settings.System.canWrite(context)) {
                    // Do stuff here
                }
                else {
                    Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS);
                    intent.setData(Uri.parse("package:" + getActivity().getPackageName()));
                    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivity(intent);
                }
            }