mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-04 23:07:38 +00:00
Updated UI for tablets
This commit is contained in:
parent
ab318ef99e
commit
c44ce77e95
@ -23,7 +23,9 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".AboutActivity"/>
|
<activity
|
||||||
|
android:name=".AboutActivity"
|
||||||
|
android:theme="@style/AppTheme.Transparent"/>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -13,6 +13,7 @@ import android.text.Html;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.RowItem;
|
import com.topjohnwu.magisk.utils.RowItem;
|
||||||
@ -135,6 +136,22 @@ public class AboutActivity extends AppCompatActivity {
|
|||||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(XDA_THREAD)));
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(XDA_THREAD)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setFloating();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFloating() {
|
||||||
|
boolean isTablet = getResources().getBoolean(R.bool.isTablet);
|
||||||
|
if (isTablet) {
|
||||||
|
WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||||
|
params.height = getResources().getDimensionPixelSize(R.dimen.floating_height);
|
||||||
|
params.width = getResources().getDimensionPixelSize(R.dimen.floating_width);
|
||||||
|
params.alpha = 1.0f;
|
||||||
|
params.dimAmount = 0.6f;
|
||||||
|
params.flags |= 2;
|
||||||
|
getWindow().setAttributes(params);
|
||||||
|
setFinishOnTouchOutside(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
android:viewportHeight="24.0"
|
android:viewportHeight="24.0"
|
||||||
android:viewportWidth="24.0">
|
android:viewportWidth="24.0">
|
||||||
<path
|
<path
|
||||||
android:fillColor="#fff"
|
android:fillColor="#FF000000"
|
||||||
android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
|
android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
12
app/src/main/res/values-sw600dp-v21/styles.xml
Normal file
12
app/src/main/res/values-sw600dp-v21/styles.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="AppTheme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
|
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||||
|
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
4
app/src/main/res/values-sw600dp/bools.xml
Normal file
4
app/src/main/res/values-sw600dp/bools.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="isTablet">true</bool>
|
||||||
|
</resources>
|
4
app/src/main/res/values/bools.xml
Normal file
4
app/src/main/res/values/bools.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="isTablet">false</bool>
|
||||||
|
</resources>
|
5
app/src/main/res/values/dimens.xml
Normal file
5
app/src/main/res/values/dimens.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<dimen name="floating_height">650dp</dimen>
|
||||||
|
<dimen name="floating_width">500dp</dimen>
|
||||||
|
</resources>
|
@ -21,4 +21,7 @@
|
|||||||
<item name="actionMenuTextColor">@color/icons</item>
|
<item name="actionMenuTextColor">@color/icons</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="AppTheme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user