settings + api28
This commit is contained in:
parent
0b030406bb
commit
5d4ea0e057
@ -1,11 +1,11 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 27
|
compileSdkVersion 28
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.blackforestbytes.simplecloudnotifier"
|
applicationId "com.blackforestbytes.simplecloudnotifier"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 27
|
targetSdkVersion 28
|
||||||
versionCode 2
|
versionCode 2
|
||||||
versionName "0.2"
|
versionName "0.2"
|
||||||
}
|
}
|
||||||
@ -24,15 +24,18 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
implementation 'com.android.support:support-v4:28.0.0'
|
||||||
implementation 'com.android.support:cardview-v7:27.1.1'
|
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||||
|
implementation 'com.android.support:cardview-v7:28.0.0'
|
||||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||||
implementation 'com.android.support:recyclerview-v7:27.1.1'
|
implementation 'com.android.support:recyclerview-v7:28.0.0'
|
||||||
implementation 'com.android.support:design:27.1.1'
|
implementation 'com.android.support:design:28.0.0'
|
||||||
|
|
||||||
|
implementation 'com.takisoft.fix:preference-v7:28.0.0.0'
|
||||||
|
implementation 'com.takisoft.fix:preference-v7-extras:28.0.0.0'
|
||||||
|
|
||||||
implementation 'com.google.firebase:firebase-core:16.0.3'
|
implementation 'com.google.firebase:firebase-core:16.0.3'
|
||||||
implementation 'com.google.firebase:firebase-messaging:17.3.2'
|
implementation 'com.google.firebase:firebase-messaging:17.3.2'
|
||||||
implementation 'com.android.support:support-v4:27.1.1'
|
|
||||||
|
|
||||||
implementation "android.arch.lifecycle:extensions:1.1.1"
|
implementation "android.arch.lifecycle:extensions:1.1.1"
|
||||||
|
|
||||||
|
@ -4,25 +4,20 @@ import android.annotation.SuppressLint;
|
|||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.graphics.drawable.VectorDrawable;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.blackforestbytes.simplecloudnotifier.R;
|
import com.blackforestbytes.simplecloudnotifier.R;
|
||||||
import com.blackforestbytes.simplecloudnotifier.SCNApp;
|
import com.blackforestbytes.simplecloudnotifier.SCNApp;
|
||||||
import com.blackforestbytes.simplecloudnotifier.model.CMessageList;
|
import com.blackforestbytes.simplecloudnotifier.model.CMessageList;
|
||||||
import com.blackforestbytes.simplecloudnotifier.model.SCNSettings;
|
import com.blackforestbytes.simplecloudnotifier.model.SCNSettings;
|
||||||
import com.blackforestbytes.simplecloudnotifier.model.ServerCommunication;
|
|
||||||
|
|
||||||
import net.glxn.qrgen.android.QRCode;
|
import net.glxn.qrgen.android.QRCode;
|
||||||
import net.glxn.qrgen.core.image.ImageType;
|
import net.glxn.qrgen.core.image.ImageType;
|
||||||
|
@ -1,30 +1,15 @@
|
|||||||
package com.blackforestbytes.simplecloudnotifier.view;
|
package com.blackforestbytes.simplecloudnotifier.view;
|
||||||
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import com.blackforestbytes.simplecloudnotifier.R;
|
import com.blackforestbytes.simplecloudnotifier.R;
|
||||||
|
|
||||||
/**
|
public class SettingsFragment extends PreferenceFragmentCompat
|
||||||
* A simple {@link Fragment} subclass.
|
{
|
||||||
*/
|
|
||||||
public class SettingsFragment extends Fragment {
|
|
||||||
|
|
||||||
|
|
||||||
public SettingsFragment() {
|
|
||||||
// Required empty public constructor
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
|
||||||
Bundle savedInstanceState) {
|
{
|
||||||
// Inflate the layout for this fragment
|
setPreferencesFromResource(R.xml.preferences, rootKey);
|
||||||
return inflater.inflate(R.layout.fragment_settings, container, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".view.SettingsFragment">
|
|
||||||
|
|
||||||
<!-- TODO: Update blank fragment layout -->
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/hello_blank_fragment" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
@ -1,7 +1,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AppTheme" parent="@style/PreferenceFixTheme.Light.NoActionBar">
|
||||||
<!-- your app branding color for the app bar -->
|
<!-- your app branding color for the app bar -->
|
||||||
<item name="colorPrimary">#3F51B5</item>
|
<item name="colorPrimary">#3F51B5</item>
|
||||||
<!-- darker variant for the status bar and contextual app bars -->
|
<!-- darker variant for the status bar and contextual app bars -->
|
||||||
|
33
android/app/src/main/res/xml/preferences.xml
Normal file
33
android/app/src/main/res/xml/preferences.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<EditTextPreference
|
||||||
|
android:key="message_count"
|
||||||
|
android:title="Keep x notifications"
|
||||||
|
android:summary="Remember tha last x notifications locally"
|
||||||
|
android:defaultValue="200" />
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:title="Notifications"
|
||||||
|
android:key="pref_key_notifications">
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="notification_enable_sound"
|
||||||
|
android:title="Notification sound"
|
||||||
|
android:summary="Play a sound when a notification is recieved"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="notification_enable_light"
|
||||||
|
android:title="Notification light"
|
||||||
|
android:summary="Turn the notification LED on when a notification is recieved"
|
||||||
|
android:defaultValue="true" />
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="notification_enable_vibrate"
|
||||||
|
android:title="Notification vibration"
|
||||||
|
android:summary="Vibrate when a notification is recieved"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
@ -19,6 +19,7 @@ allprojects {
|
|||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
|
maven { url "https://dl.bintray.com/gericop/maven" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user