settings + api28

This commit is contained in:
Mike Schwörer 2018-09-27 02:30:12 +02:00
parent 0b030406bb
commit 5d4ea0e057
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
8 changed files with 53 additions and 49 deletions

View File

@ -1,11 +1,11 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "com.blackforestbytes.simplecloudnotifier"
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 28
versionCode 2
versionName "0.2"
}
@ -24,15 +24,18 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v4:28.0.0'
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:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
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-messaging:17.3.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation "android.arch.lifecycle:extensions:1.1.1"

View File

@ -4,25 +4,20 @@ import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.VectorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.blackforestbytes.simplecloudnotifier.R;
import com.blackforestbytes.simplecloudnotifier.SCNApp;
import com.blackforestbytes.simplecloudnotifier.model.CMessageList;
import com.blackforestbytes.simplecloudnotifier.model.SCNSettings;
import com.blackforestbytes.simplecloudnotifier.model.ServerCommunication;
import net.glxn.qrgen.android.QRCode;
import net.glxn.qrgen.core.image.ImageType;

View File

@ -1,30 +1,15 @@
package com.blackforestbytes.simplecloudnotifier.view;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.support.v7.preference.PreferenceFragmentCompat;
import com.blackforestbytes.simplecloudnotifier.R;
/**
* A simple {@link Fragment} subclass.
*/
public class SettingsFragment extends Fragment {
public SettingsFragment() {
// Required empty public constructor
}
public class SettingsFragment extends PreferenceFragmentCompat
{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_settings, container, false);
public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
{
setPreferencesFromResource(R.xml.preferences, rootKey);
}
}

View File

@ -1,5 +1,6 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -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>

View File

@ -1,7 +1,7 @@
<resources>
<!-- 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 -->
<item name="colorPrimary">#3F51B5</item>
<!-- darker variant for the status bar and contextual app bars -->

View 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>

View File

@ -19,6 +19,7 @@ allprojects {
google()
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://dl.bintray.com/gericop/maven" }
}
}