diff --git a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt index ac7814a..6e97651 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt @@ -1,11 +1,7 @@ package io.heckel.ntfy.ui -import android.app.NotificationChannel -import android.app.NotificationManager -import android.content.Context import android.content.Intent import android.net.Uri -import android.os.Build import android.os.Bundle import android.util.Log import android.view.Menu @@ -13,36 +9,19 @@ import android.view.MenuItem import android.view.View import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity -import androidx.core.app.NotificationCompat -import androidx.core.app.NotificationManagerCompat import androidx.recyclerview.widget.RecyclerView import com.google.android.gms.tasks.OnCompleteListener -import io.heckel.ntfy.R -import kotlin.random.Random import com.google.firebase.messaging.FirebaseMessaging +import io.heckel.ntfy.R import io.heckel.ntfy.app.Application -import io.heckel.ntfy.data.* +import io.heckel.ntfy.data.Subscription +import kotlin.random.Random class MainActivity : AppCompatActivity(), AddFragment.AddSubscriptionListener { private val subscriptionsViewModel by viewModels { SubscriptionsViewModelFactory((application as Application).repository) } - fun doStuff() { - FirebaseMessaging.getInstance().token.addOnCompleteListener(OnCompleteListener { task -> - if (!task.isSuccessful) { - Log.w(TAG, "Fetching FCM registration token failed", task.exception) - return@OnCompleteListener - } - - // Get new FCM registration token - val token = task.result - - // Log and toast - Log.d(TAG, "message token: $token") - }) - } - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.main_activity) diff --git a/app/src/main/res/drawable/ic_add_white_24dp.xml b/app/src/main/res/drawable/ic_add_black_24dp.xml similarity index 88% rename from app/src/main/res/drawable/ic_add_white_24dp.xml rename to app/src/main/res/drawable/ic_add_black_24dp.xml index b9b8eca..7d80040 100644 --- a/app/src/main/res/drawable/ic_add_white_24dp.xml +++ b/app/src/main/res/drawable/ic_add_black_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/layout/main_activity.xml b/app/src/main/res/layout/main_activity.xml index 630cae5..ac29407 100644 --- a/app/src/main/res/layout/main_activity.xml +++ b/app/src/main/res/layout/main_activity.xml @@ -29,7 +29,8 @@ android:layout_height="wrap_content" android:layout_margin="16dp" android:contentDescription="@string/main_add_button_description" - android:src="@drawable/ic_add_white_24dp" + android:src="@drawable/ic_add_black_24dp" + app:tint="@color/primaryLightTextColor" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:backgroundTint="@color/primaryColor"/> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ac6c9dc..0f43656 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,8 +1,10 @@ - #4ecb26 - #87ff5c - #009900 + #44b220 + #44b220 + #44b220 + #000000 + #FFFFFF diff --git a/assets/launcher.svg b/assets/launcher.svg index 9b43937..46df260 100644 --- a/assets/launcher.svg +++ b/assets/launcher.svg @@ -8,8 +8,8 @@ version="1.1" id="svg8" inkscape:version="1.1.1 (3bf5ae0, 2021-09-20)" - sodipodi:docname="launcher.svg" - inkscape:export-filename="/home/pheckel/Code/ntfy-android/assets/launcher_round.png" + sodipodi:docname="launcher_20.svg" + inkscape:export-filename="/home/pheckel/Code/ntfy-android/assets/launcher_20_fg.png" inkscape:export-xdpi="258.69" inkscape:export-ydpi="258.69" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" @@ -22,6 +22,30 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> + + + + + + + + @@ -30,13 +54,33 @@ offset="0" id="stop839" /> + + + + transform="matrix(1.302925,0,0,1.302925,-20.839797,-37.163349)"> + + d="M 93.687597,89.445767 H 73.874439 c -1.36217,0 -2.476659,1.051813 -2.476659,2.337352 v 21.036241 l 4.9533,-4.67471 h 17.336517 c 1.362173,0 2.476651,-1.05183 2.476651,-2.3374 V 91.783119 c 0,-1.285539 -1.114478,-2.337352 -2.476651,-2.337352 z M 80.066048,99.963882 H 77.58941 v -2.337346 h 2.476638 z m 4.953301,0 h -2.476662 v -2.337346 h 2.476662 z m 4.953276,0 H 87.49599 v -2.337346 h 2.476635 z" + id="path403" /> + id="layer3" + inkscape:label="round icon preview"> + style="display:inline;fill:#ffffff;fill-opacity:1;stroke-width:0.264583" + d="M 1e-6,-3e-6 V 50.27083 H 22.272026 A 25.220409,25.220409 0 0 1 0.008786,25.241867 25.220409,25.220409 0 0 1 25.228952,0.021184 25.220409,25.220409 0 0 1 50.270834,22.261687 V -3e-6 Z M 50.270834,28.086655 A 25.220409,25.220409 0 0 1 28.186394,50.27083 h 22.08444 z" /> diff --git a/assets/launcher_20_bg.png b/assets/launcher_20_bg.png deleted file mode 100644 index 0d4b251..0000000 Binary files a/assets/launcher_20_bg.png and /dev/null differ diff --git a/assets/launcher_20_fg.png b/assets/launcher_20_fg.png deleted file mode 100644 index e9de615..0000000 Binary files a/assets/launcher_20_fg.png and /dev/null differ diff --git a/assets/launcher_bg.png b/assets/launcher_bg.png index d1468fd..0d4b251 100644 Binary files a/assets/launcher_bg.png and b/assets/launcher_bg.png differ diff --git a/assets/launcher_fg.png b/assets/launcher_fg.png index d8829b7..e9de615 100644 Binary files a/assets/launcher_fg.png and b/assets/launcher_fg.png differ diff --git a/assets/launcher.png b/assets/old/launcher.png similarity index 100% rename from assets/launcher.png rename to assets/old/launcher.png diff --git a/assets/old/launcher.svg b/assets/old/launcher.svg new file mode 100644 index 0000000..c4c825a --- /dev/null +++ b/assets/old/launcher.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/assets/launcher_20.svg b/assets/old/launcher_21.svg similarity index 68% rename from assets/launcher_20.svg rename to assets/old/launcher_21.svg index 7f39544..c4de838 100644 --- a/assets/launcher_20.svg +++ b/assets/old/launcher_21.svg @@ -8,8 +8,8 @@ version="1.1" id="svg8" inkscape:version="1.1.1 (3bf5ae0, 2021-09-20)" - sodipodi:docname="launcher_20.svg" - inkscape:export-filename="/home/pheckel/Code/ntfy-android/assets/launcher_13_bg.png" + sodipodi:docname="launcher_21.svg" + inkscape:export-filename="/home/pheckel/Code/ntfy-android/assets/launcher_20_fg.png" inkscape:export-xdpi="258.69" inkscape:export-ydpi="258.69" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" @@ -24,15 +24,27 @@ id="defs2"> + id="linearGradient11307"> + id="stop11303" /> + id="stop11305" /> + + + + + gradientTransform="matrix(1.2406313,0,0,1.2406313,-16.29538,-29.727622)" /> + gradientTransform="matrix(1.2477856,0,0,1.2406313,-16.722298,-29.727622)" /> + @@ -145,17 +166,17 @@ transform="translate(-51.147327,-81.515579)" style="display:inline"> + width="34.183018" + height="25.561861" + x="57.735481" + y="96.749779" /> + transform="matrix(1.2406313,0,0,1.2406313,-16.118887,-30.564776)"> + width="34.380138" + height="6.3300505" + x="57.735481" + y="96.749779" /> + + + diff --git a/assets/old/launcher_bg.png b/assets/old/launcher_bg.png new file mode 100644 index 0000000..d1468fd Binary files /dev/null and b/assets/old/launcher_bg.png differ diff --git a/assets/old/launcher_fg.png b/assets/old/launcher_fg.png new file mode 100644 index 0000000..d8829b7 Binary files /dev/null and b/assets/old/launcher_fg.png differ diff --git a/assets/launcher_round.png b/assets/old/launcher_round.png similarity index 100% rename from assets/launcher_round.png rename to assets/old/launcher_round.png