Browse Source

test logo usage with mipmap and pre-rendered icon

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/35/head
R4SAS 2 years ago
parent
commit
d14589f944
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 2
      app/src/main/AndroidManifest.xml
  2. 18
      app/src/main/java/org/purplei2p/i2pd/SettingsActivity.java
  3. 0
      app/src/main/res/drawable/ic_logo.xml
  4. 2
      app/src/main/res/layout/activity_main.xml
  5. 112
      app/src/main/res/mipmap-anydpi-v26/logo.xml
  6. BIN
      app/src/main/res/mipmap-hdpi/ic_logo.png
  7. BIN
      app/src/main/res/mipmap-hdpi/logo.png
  8. BIN
      app/src/main/res/mipmap-mdpi/ic_logo.png
  9. BIN
      app/src/main/res/mipmap-mdpi/logo.png
  10. BIN
      app/src/main/res/mipmap-xhdpi/ic_logo.png
  11. BIN
      app/src/main/res/mipmap-xhdpi/logo.png
  12. BIN
      app/src/main/res/mipmap-xxhdpi/ic_logo.png
  13. BIN
      app/src/main/res/mipmap-xxhdpi/logo.png
  14. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_logo.png
  15. BIN
      app/src/main/res/mipmap-xxxhdpi/logo.png

2
app/src/main/AndroidManifest.xml

@ -15,7 +15,7 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_logo" android:icon="@mipmap/logo"
android:label="@string/app_name" android:label="@string/app_name"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar" android:theme="@android:style/Theme.Holo.Light.DarkActionBar"

18
app/src/main/java/org/purplei2p/i2pd/SettingsActivity.java

@ -54,7 +54,7 @@ public class SettingsActivity extends Activity {
} }
List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() > 0) { if (list.size() > 0) {
startActivity(intent); startActivity(intent);
} }
} catch (Exception e) { } catch (Exception e) {
@ -82,27 +82,29 @@ public class SettingsActivity extends Activity {
cacheDir = getApplicationContext().getCacheDir(); cacheDir = getApplicationContext().getCacheDir();
setContentView(R.layout.activity_settings); setContentView(R.layout.activity_settings);
Switch autostart_switch = findViewById(R.id.autostart_enable); Switch autostart_switch = findViewById(R.id.autostart_enable);
File onBoot= new File( cacheDir.getAbsolutePath()+onBootFileName); File onBoot = new File(cacheDir.getAbsolutePath() + onBootFileName);
autostart_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { autostart_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// do something, the isChecked will be // do something, the isChecked will be
// true if the switch is in the On position // true if the switch is in the On position
if(isChecked){ if (isChecked) {
if( !onBoot.exists() ) { if (!onBoot.exists()) {
requestPermission(); requestPermission();
addAutoStartupswitch(); addAutoStartupswitch();
try { try {
if( !onBoot.createNewFile()) Log.d(TAG, "Cant create new wile on: "+onBoot.getAbsolutePath()); if (!onBoot.createNewFile())
Log.d(TAG, "Cant create new wile on: "+onBoot.getAbsolutePath());
} catch (Exception e) { } catch (Exception e) {
Log.d(TAG, "error: " + e.toString()); Log.d(TAG, "error: " + e.toString());
} }
} }
}else{ } else {
if( onBoot.exists() ) if (onBoot.exists())
onBoot.delete(); onBoot.delete();
} }
} }
}); });
if(onBoot.exists()) autostart_switch.setChecked(true); if(onBoot.exists())
autostart_switch.setChecked(true);
} }
} }

0
app/src/main/res/mipmap-anydpi-v26/ic_logo.xml → app/src/main/res/drawable/ic_logo.xml

2
app/src/main/res/layout/activity_main.xml

@ -17,7 +17,7 @@
android:id="@+id/mainLogo" android:id="@+id/mainLogo"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="140dp" android:layout_height="140dp"
android:src="@mipmap/ic_logo" /> android:src="@drawable/ic_logo" />
<TextView <TextView
style="@android:style/Widget.Holo.Light.TextView.SpinnerItem" style="@android:style/Widget.Holo.Light.TextView.SpinnerItem"

112
app/src/main/res/mipmap-anydpi-v26/logo.xml

File diff suppressed because one or more lines are too long

BIN
app/src/main/res/mipmap-hdpi/ic_logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

BIN
app/src/main/res/mipmap-hdpi/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
app/src/main/res/mipmap-mdpi/ic_logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

BIN
app/src/main/res/mipmap-mdpi/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
app/src/main/res/mipmap-xhdpi/ic_logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

BIN
app/src/main/res/mipmap-xhdpi/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
app/src/main/res/mipmap-xxhdpi/ic_logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

BIN
app/src/main/res/mipmap-xxhdpi/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
app/src/main/res/mipmap-xxxhdpi/ic_logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
app/src/main/res/mipmap-xxxhdpi/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Loading…
Cancel
Save