mirror of
https://github.com/PurpleI2P/i2pd-android.git
synced 2025-02-03 02:14:24 +00:00
Main activity, replace drawables with SVGs
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
fe7af298e0
commit
48555bd1af
@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.core:core:1.3.0'
|
||||
implementation 'androidx.core:core:1.3.2'
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
}
|
||||
|
||||
@ -18,6 +18,8 @@ android {
|
||||
versionName "2.36.0"
|
||||
setProperty("archivesBaseName", archivesBaseName + "-" + versionName)
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a"
|
||||
abiFilters "x86"
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/icon"
|
||||
android:icon="@drawable/ic_logo"
|
||||
android:label="@string/app_name"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:theme="@android:style/Theme.Holo.Light.DarkActionBar"
|
||||
|
@ -148,7 +148,7 @@ public class ForegroundService extends Service {
|
||||
// Set the info for the views that show in the notification panel.
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, channelId)
|
||||
.setOngoing(true)
|
||||
.setSmallIcon(R.drawable.itoopie_notification_icon); // the status icon
|
||||
.setSmallIcon(R.drawable.ic_notification_icon); // the status icon
|
||||
if (Build.VERSION.SDK_INT >= 16)
|
||||
builder = builder.setPriority(Notification.PRIORITY_DEFAULT);
|
||||
if (Build.VERSION.SDK_INT >= 21)
|
||||
|
@ -34,13 +34,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
// For future package update checking
|
||||
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
|
||||
import static android.provider.Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS;
|
||||
|
||||
public class I2PDActivity extends Activity {
|
||||
@ -98,6 +91,9 @@ public class I2PDActivity extends Activity {
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
Log.i(TAG, "onCreate");
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
textView = (TextView) findViewById(R.id.textView);
|
||||
|
||||
if (daemon == null) {
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
@ -105,8 +101,6 @@ public class I2PDActivity extends Activity {
|
||||
}
|
||||
ForegroundService.init(daemon);
|
||||
|
||||
textView = new TextView(this);
|
||||
setContentView(textView);
|
||||
daemon.addStateChangeListener(daemonStateUpdatedListener);
|
||||
daemonStateUpdatedListener.daemonStateUpdate(DaemonWrapper.State.uninitialized, daemon.getState());
|
||||
|
||||
@ -119,7 +113,6 @@ public class I2PDActivity extends Activity {
|
||||
}
|
||||
}
|
||||
|
||||
// set the app be foreground
|
||||
doBindService();
|
||||
|
||||
final Timer gracefulQuitTimer = getGracefulQuitTimer();
|
||||
@ -478,6 +471,6 @@ public class I2PDActivity extends Activity {
|
||||
} catch (Throwable tr) {
|
||||
Log.e(TAG, "", tr);
|
||||
}
|
||||
System.exit(0);
|
||||
//System.exit(0);
|
||||
}
|
||||
}
|
||||
|
@ -35,13 +35,13 @@ public class WebConsoleActivity extends Activity {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
swipeRefreshLayout.setRefreshing(true);
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
new Handler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
webView.reload();
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
112
app/src/main/res/drawable/ic_logo.xml
Normal file
112
app/src/main/res/drawable/ic_logo.xml
Normal file
File diff suppressed because one or more lines are too long
16
app/src/main/res/drawable/ic_notification_icon.xml
Normal file
16
app/src/main/res/drawable/ic_notification_icon.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="67.73333"
|
||||
android:viewportHeight="67.73333">
|
||||
<path
|
||||
android:pathData="m8.0245,22.7306 l3.0405,8.9748c1.5868,8.52 4.2051,13.7196 7.5287,16.6465 3.3713,5.5488 7.1982,10.5662 11.7274,14.7649 4.7511,5.7799 10.8578,5.4198 16.9394,-1.158C55.1176,53.4605 59.0051,38.7386 60.7254,22.4411 62.721,3.5354 42.4318,-7.8385 33.7958,8.6896 28.6579,18.5229 27.1239,16.8872 19.8967,9.9923 12.8025,3.2243 3.3349,7.2924 8.0245,22.7306ZM13.0159,27.4774c8.3005,0.3473 14.1412,1.6329 15.1198,4.7738 -6.159,3.137 -10.9848,0.7573 -15.1198,-4.7738zM32.6816,52.0871c1.0397,0.5898 1.771,0.6068 2.5288,0 1.4061,-1.1262 2.4482,-1.0302 4.6962,-1.8419 3.5633,-1.2868 5.1391,-4.6341 7.7089,-6.9512 -4.9698,6.6991 -9.1788,18.7408 -16.8256,11.1857 -1.918,-1.8951 -1.9664,-2.4746 -7.4966,-7.0568 -0.227,-0.188 -0.4631,-0.3828 -0.709,-0.5847 2.5469,1.5209 4.8048,3.3307 7.6408,4.5628 0.8113,0.3309 1.3046,0.0329 2.4565,0.6862zM35.8244,31.5361c-1.4116,-5.7378 3.8919,-8.1189 14.2333,-7.9819 -4.2543,3.8297 -8.7242,7.145 -14.2333,7.9819z"
|
||||
android:strokeWidth="0.93224764"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#000000"/>
|
||||
<path
|
||||
android:pathData="m28.237,32.0881c-0.9786,-3.1408 -6.8193,-4.4264 -15.1199,-4.7737 4.1351,5.531 8.9609,7.9108 15.1199,4.7737zM50.159,23.3911c-10.3414,-0.137 -15.6448,2.2441 -14.2333,7.982 5.5091,-0.8369 9.979,-4.1522 14.2333,-7.982zM16.6812,21.3597c2.6043,2.2517 5.2086,4.0418 7.8132,4.5568 5.297,1.7061 5.6425,5.3779 5.281,9.3305v9.3306c-0.3217,3.4969 1.857,4.0152 3.1473,2.4946 0.6986,-0.8231 2.1465,-1.8057 3.3777,-1.9377 1.8931,-0.2029 3.3969,-0.1184 2.3733,-3.2692m-5.5705,0.5424c-0.0241,-4.2433 -0.0482,-8.4866 -0.0725,-12.73M16.6089,18.3219C26.541,27.559 30.9945,26.1085 34.7671,17.0923 39.72,5.2558 49.1877,4.4588 57.1215,16.3689m-9.4048,26.7619c-4.9696,6.6991 -9.1786,18.741 -16.8254,11.1857 -1.9968,-1.9727 -1.9672,-2.5199 -8.2055,-7.6415 2.5469,1.5209 4.8048,3.3307 7.6407,4.5628 0.8114,0.3309 1.3047,0.033 2.4566,0.6863 1.0397,0.5898 1.771,0.6068 2.5286,0 1.4062,-1.1262 2.4482,-1.0302 4.6963,-1.8421 3.5633,-1.2868 5.1391,-4.634 7.7087,-6.9512zM8.1259,22.5676C3.4362,7.1294 12.9037,3.0612 19.9981,9.8293 27.2253,16.7242 28.7593,18.3597 33.8971,8.5266 42.533,-8.0016 62.8223,3.3724 60.8266,22.2781 59.1064,38.5756 55.219,53.2975 47.3619,61.7957 41.2802,68.3735 35.1735,68.7337 30.4224,62.9537 25.8932,58.755 22.0663,53.7378 18.695,48.1889 15.3714,45.2618 12.7532,40.0624 11.1664,31.5422ZM33.3926,50.5808c0.1014,-0.4791 -0.0722,-4.2248 1.5204,-0.0957m1.5285,14.3353c-2.607,-2.3561 2.1116,-3.9639 1.4121,-0.4185M53.8771,36.4639C54.0218,43.6533 51.5124,52.1936 47.7962,57.4531M42.4392,40.3723c6.1774,-3.3295 9.073,-2.4125 8.687,2.7503M15.2932,40.8065c1.5452,3.6162 6.1047,4.1223 9.4827,-1.3028M10.0255,21.7213C9.1816,8.2922 13.3214,6.1141 21.0941,16.9476 25.1871,22.652 28.8678,23.6838 32.6692,15.3563 39.433,0.5392 50.2361,1.582 57.2465,12.0746M33.682,24.2528c6.4671,-11.5489 12.2697,-16.0091 17.0008,-9.0411"
|
||||
android:strokeWidth="1.32291663"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#1f1a17"/>
|
||||
</vector>
|
Binary file not shown.
Before Width: | Height: | Size: 36 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB |
37
app/src/main/res/layout/activity_main.xml
Normal file
37
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/activity_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
tools:context="org.purplei2p.i2pd.I2PDActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="140dp"
|
||||
android:src="@drawable/ic_logo" />
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
@ -1,16 +1,12 @@
|
||||
<resources>
|
||||
|
||||
<!-- Define standard dimensions to comply with Holo-style grids and rhythm. -->
|
||||
|
||||
<dimen name="margin_tiny">4dp</dimen>
|
||||
<dimen name="margin_small">8dp</dimen>
|
||||
<dimen name="margin_medium">16dp</dimen>
|
||||
<dimen name="margin_large">32dp</dimen>
|
||||
<dimen name="margin_huge">64dp</dimen>
|
||||
|
||||
<!-- Semantic definitions -->
|
||||
|
||||
<dimen name="horizontal_page_margin">@dimen/margin_medium</dimen>
|
||||
<dimen name="vertical_page_margin">@dimen/margin_medium</dimen>
|
||||
|
||||
<dimen name="activity_horizontal_margin">@dimen/margin_medium</dimen>
|
||||
<dimen name="activity_vertical_margin">@dimen/margin_medium</dimen>
|
||||
</resources>
|
@ -2,6 +2,7 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
|
||||
<string name="app_name">i2pd</string>
|
||||
|
||||
<string name="action_start">Start</string>
|
||||
<string name="action_stop">Stop</string>
|
||||
<string name="action_graceful_stop">Graceful Stop</string>
|
||||
<string name="action_cancel_graceful_stop">Cancel Graceful Stop</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user