Miscellaneous
This commit is contained in:
@@ -17,6 +17,7 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.io.IOException;
|
||||
|
||||
public class TitanMiniModeQSTileService extends TileService {
|
||||
SharedPreferences pref;
|
||||
Display display;
|
||||
|
||||
static void setDisplaySize(long x, long y) {
|
||||
runAsRoot("wm size " + x + "x" + y);
|
||||
@@ -36,10 +37,17 @@ public class TitanMiniModeQSTileService extends TileService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileAdded() {
|
||||
super.onTileAdded();
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
pref = getBaseContext().getSharedPreferences(
|
||||
"cfpi_fpsi.eu.titan_mini_mode.PREFERENCE_FILE_KEY", Context.MODE_PRIVATE);
|
||||
WindowManager wm = (WindowManager) getBaseContext().getSystemService(Context.WINDOW_SERVICE);
|
||||
display = wm.getDefaultDisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileAdded() {
|
||||
super.onTileAdded();
|
||||
// When the tile is first added, we save the original screen size into the preferences.
|
||||
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
|
||||
SharedPreferences.Editor editor = pref.edit();
|
||||
@@ -60,9 +68,6 @@ public class TitanMiniModeQSTileService extends TileService {
|
||||
public void onStartListening() {
|
||||
super.onStartListening();
|
||||
|
||||
pref = getBaseContext().getSharedPreferences(
|
||||
"cfpi_fpsi.eu.titan_mini_mode.PREFERENCE_FILE_KEY", Context.MODE_PRIVATE);
|
||||
|
||||
Tile tile = getQsTile();
|
||||
Point currentScreenSize = getCurrentScreenSize();
|
||||
Point originalScreenSize = getOriginalScreenSize();
|
||||
@@ -103,8 +108,6 @@ public class TitanMiniModeQSTileService extends TileService {
|
||||
}
|
||||
|
||||
private Point getCurrentScreenSize() {
|
||||
WindowManager wm = (WindowManager) getBaseContext().getSystemService(Context.WINDOW_SERVICE);
|
||||
Display display = wm.getDefaultDisplay();
|
||||
Point size = new Point();
|
||||
display.getSize(size);
|
||||
return size;
|
||||
|
||||
Reference in New Issue
Block a user