Add notification permission activity

This commit is contained in:
Shinokuni 2020-03-14 14:35:53 +01:00
parent 4762828980
commit c4848fc7c6
5 changed files with 82 additions and 1 deletions

View File

@ -29,6 +29,10 @@
android:resource="@xml/file_paths" />
</provider>
<activity
android:name=".activities.NotificationPermissionActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".activities.WebViewActivity"
android:theme="@style/AppTheme.NoActionBar" />
@ -44,6 +48,7 @@
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
@ -71,11 +76,12 @@
android:parentActivityName=".activities.MainActivity">
<intent-filter android:label="@string/new_feed">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,21 @@
package com.readrops.app.activities
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.LinearLayoutManager
import com.readrops.app.R
import com.readrops.app.adapters.NotificationPermissionAdapter
import com.readrops.app.databinding.ActivityNotificationPermissionBinding
class NotificationPermissionActivity : AppCompatActivity() {
lateinit var binding: ActivityNotificationPermissionBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, R.layout.activity_notification_permission)
binding.notifPermissionAccountList.layoutManager = LinearLayoutManager(this)
}
}

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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"
tools:context="com.readrops.app.activities.NotificationPermissionActivity">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/notif_permission_account_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/notif_permission_account"
style="@style/TextAppearance.AppCompat.Subhead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginEnd="8dp"
android:layout_toStartOf="@id/notif_permission_account_switch"
android:text="@string/enable_notifications" />
<Switch
android:id="@+id/notif_permission_account_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/notif_permission_account_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/notif_permission_account_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</layout>

View File

@ -123,5 +123,6 @@
<string name="every_day">Chaque jour</string>
<string name="account_synchro">Synchronisation des comptes</string>
<string name="new_items">%1$s nouveaux articles</string>
<string name="enable_notifications">Activer les notifications</string>
</resources>

View File

@ -129,4 +129,5 @@
<string name="every_day">Every day</string>
<string name="account_synchro">Accounts synchronisation</string>
<string name="new_items">%1$s new articles</string>
<string name="enable_notifications">Enable notifications</string>
</resources>