Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
54a171bd5e
|
|||
c043367810
|
|||
5494df1c56
|
|||
f9d04e38a0
|
|||
6dfd7e016b
|
|||
96a3cbc40a
|
|||
7261795c99
|
|||
d6becd15c1
|
|||
0b22a18088
|
|||
39fcddfaf0
|
|||
![]() |
38eaa0c132 |
@@ -35,23 +35,22 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
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: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 'androidx.appcompat:appcompat:1.0.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
||||
|
||||
implementation 'com.google.android.material:material:1.0.0'
|
||||
implementation 'com.google.firebase:firebase-core:16.0.4'
|
||||
implementation 'com.google.firebase:firebase-messaging:17.3.3'
|
||||
|
||||
implementation "android.arch.lifecycle:extensions:1.1.1"
|
||||
implementation 'com.google.firebase:firebase-messaging:17.3.4'
|
||||
implementation 'com.google.android.gms:play-services-ads:17.0.0'
|
||||
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
||||
implementation 'com.github.kenglxn.QRGen:android:2.5.0'
|
||||
implementation "com.github.DeweyReed:UltimateMusicPicker:2.0.0"
|
||||
implementation 'com.github.duanhong169:colorpicker:1.1.5'
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
@@ -1,15 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.blackforestbytes.simplecloudnotifier">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="false"
|
||||
android:name="SCNApp"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@drawable/icon"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
|
||||
<activity android:name=".view.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -19,8 +24,10 @@
|
||||
|
||||
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/icon" />
|
||||
<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/colorAccent" />
|
||||
<meta-data android:name="com.google.android.gms.ads.AD_MANAGER_APP" android:value="true"/>
|
||||
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3320562328966175~7579972005"/>
|
||||
|
||||
<service android:name=".service.FBMService">
|
||||
<service android:name=".service.FBMService" android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
|
@@ -1,26 +1,26 @@
|
||||
package com.blackforestbytes.simplecloudnotifier;
|
||||
|
||||
import android.app.Application;
|
||||
import android.arch.lifecycle.Lifecycle;
|
||||
import android.arch.lifecycle.LifecycleObserver;
|
||||
import android.arch.lifecycle.OnLifecycleEvent;
|
||||
import android.arch.lifecycle.ProcessLifecycleOwner;
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.blackforestbytes.simplecloudnotifier.model.CMessageList;
|
||||
import com.blackforestbytes.simplecloudnotifier.service.NotificationService;
|
||||
import com.blackforestbytes.simplecloudnotifier.view.AccountFragment;
|
||||
import com.blackforestbytes.simplecloudnotifier.view.MainActivity;
|
||||
import com.blackforestbytes.simplecloudnotifier.view.TabAdapter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.lifecycle.OnLifecycleEvent;
|
||||
import androidx.lifecycle.ProcessLifecycleOwner;
|
||||
|
||||
public class SCNApp extends Application implements LifecycleObserver
|
||||
{
|
||||
private static SCNApp instance;
|
||||
private static WeakReference<MainActivity> mainActivity;
|
||||
|
||||
public static final boolean LOCAL_DEBUG = BuildConfig.DEBUG;
|
||||
public static final boolean DEBUG = BuildConfig.DEBUG || !BuildConfig.VERSION_NAME.endsWith(".0");
|
||||
public static final boolean RELEASE = !DEBUG;
|
||||
|
||||
@@ -37,6 +37,11 @@ public class SCNApp extends Application implements LifecycleObserver
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static MainActivity getMainActivity()
|
||||
{
|
||||
return mainActivity.get();
|
||||
}
|
||||
|
||||
public static boolean isBackground()
|
||||
{
|
||||
return isBackground;
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package com.blackforestbytes.simplecloudnotifier.model;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
|
||||
public class NotificationSettings
|
||||
{
|
||||
public boolean EnableSound = false;
|
||||
public String SoundName = "";
|
||||
public String SoundSource = Uri.EMPTY.toString();
|
||||
public boolean RepeatSound = false;
|
||||
|
||||
public boolean EnableLED = false;
|
||||
public int LEDColor = Color.BLUE;
|
||||
|
||||
public boolean EnableVibration = false;
|
||||
}
|
@@ -22,6 +22,12 @@ public class SCNSettings
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
public final static Integer[] CHOOSABLE_CACHE_SIZES = new Integer[]{20, 50, 100, 200, 500, 1000, 2000, 5000};
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
public int quota_curr;
|
||||
public int quota_max;
|
||||
public int user_id;
|
||||
@@ -30,6 +36,17 @@ public class SCNSettings
|
||||
public String fcm_token_local;
|
||||
public String fcm_token_server;
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
public boolean Enabled = true;
|
||||
public int LocalCacheSize = 500;
|
||||
|
||||
public final NotificationSettings PriorityLow = new NotificationSettings();
|
||||
public final NotificationSettings PriorityNorm = new NotificationSettings();
|
||||
public final NotificationSettings PriorityHigh = new NotificationSettings();
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
public SCNSettings()
|
||||
{
|
||||
SharedPreferences sharedPref = SCNApp.getContext().getSharedPreferences("Config", Context.MODE_PRIVATE);
|
||||
@@ -40,6 +57,33 @@ public class SCNSettings
|
||||
user_key = sharedPref.getString("user_key", "");
|
||||
fcm_token_local = sharedPref.getString("fcm_token_local", "");
|
||||
fcm_token_server = sharedPref.getString("fcm_token_server", "");
|
||||
|
||||
Enabled = sharedPref.getBoolean("app_enabled", Enabled);
|
||||
LocalCacheSize = sharedPref.getInt("local_cache_size", LocalCacheSize);
|
||||
|
||||
PriorityLow.EnableLED = sharedPref.getBoolean("priority_low:enabled_led", PriorityLow.EnableLED);
|
||||
PriorityLow.EnableSound = sharedPref.getBoolean("priority_low:enabled_sound", PriorityLow.EnableSound);
|
||||
PriorityLow.EnableVibration = sharedPref.getBoolean("priority_low:enabled_vibration", PriorityLow.EnableVibration);
|
||||
PriorityLow.RepeatSound = sharedPref.getBoolean("priority_low:repeat_sound", PriorityLow.RepeatSound);
|
||||
PriorityLow.SoundName = sharedPref.getString( "priority_low:sound_name", PriorityLow.SoundName);
|
||||
PriorityLow.SoundSource = sharedPref.getString( "priority_low:sound_source", PriorityLow.SoundSource);
|
||||
PriorityLow.LEDColor = sharedPref.getInt( "priority_low:led_color", PriorityLow.LEDColor);
|
||||
|
||||
PriorityNorm.EnableLED = sharedPref.getBoolean("priority_norm:enabled_led", PriorityNorm.EnableLED);
|
||||
PriorityNorm.EnableSound = sharedPref.getBoolean("priority_norm:enabled_sound", PriorityNorm.EnableSound);
|
||||
PriorityNorm.EnableVibration = sharedPref.getBoolean("priority_norm:enabled_vibration", PriorityNorm.EnableVibration);
|
||||
PriorityNorm.RepeatSound = sharedPref.getBoolean("priority_norm:repeat_sound", PriorityNorm.RepeatSound);
|
||||
PriorityNorm.SoundName = sharedPref.getString( "priority_norm:sound_name", PriorityNorm.SoundName);
|
||||
PriorityNorm.SoundSource = sharedPref.getString( "priority_norm:sound_source", PriorityNorm.SoundSource);
|
||||
PriorityNorm.LEDColor = sharedPref.getInt( "priority_norm:led_color", PriorityNorm.LEDColor);
|
||||
|
||||
PriorityHigh.EnableLED = sharedPref.getBoolean("priority_high:enabled_led", PriorityHigh.EnableLED);
|
||||
PriorityHigh.EnableSound = sharedPref.getBoolean("priority_high:enabled_sound", PriorityHigh.EnableSound);
|
||||
PriorityHigh.EnableVibration = sharedPref.getBoolean("priority_high:enabled_vibration", PriorityHigh.EnableVibration);
|
||||
PriorityHigh.RepeatSound = sharedPref.getBoolean("priority_high:repeat_sound", PriorityHigh.RepeatSound);
|
||||
PriorityHigh.SoundName = sharedPref.getString( "priority_high:sound_name", PriorityHigh.SoundName);
|
||||
PriorityHigh.SoundSource = sharedPref.getString( "priority_high:sound_source", PriorityHigh.SoundSource);
|
||||
PriorityHigh.LEDColor = sharedPref.getInt( "priority_high:led_color", PriorityHigh.LEDColor);
|
||||
}
|
||||
|
||||
public void save()
|
||||
@@ -54,6 +98,33 @@ public class SCNSettings
|
||||
e.putString( "fcm_token_local", fcm_token_local);
|
||||
e.putString( "fcm_token_server", fcm_token_server);
|
||||
|
||||
e.putBoolean("app_enabled", Enabled);
|
||||
e.putInt( "local_cache_size", LocalCacheSize);
|
||||
|
||||
e.putBoolean("priority_low:enabled_led", PriorityLow.EnableLED);
|
||||
e.putBoolean("priority_low:enabled_sound", PriorityLow.EnableSound);
|
||||
e.putBoolean("priority_low:enabled_vibration", PriorityLow.EnableVibration);
|
||||
e.putBoolean("priority_low:repeat_sound", PriorityLow.RepeatSound);
|
||||
e.putString( "priority_low:sound_name", PriorityLow.SoundName);
|
||||
e.putString( "priority_low:sound_source", PriorityLow.SoundSource);
|
||||
e.putInt( "priority_low:led_color", PriorityLow.LEDColor);
|
||||
|
||||
e.putBoolean("priority_norm:enabled_led", PriorityNorm.EnableLED);
|
||||
e.putBoolean("priority_norm:enabled_sound", PriorityNorm.EnableSound);
|
||||
e.putBoolean("priority_norm:enabled_vibration", PriorityNorm.EnableVibration);
|
||||
e.putBoolean("priority_norm:repeat_sound", PriorityNorm.RepeatSound);
|
||||
e.putString( "priority_norm:sound_name", PriorityNorm.SoundName);
|
||||
e.putString( "priority_norm:sound_source", PriorityNorm.SoundSource);
|
||||
e.putInt( "priority_norm:led_color", PriorityNorm.LEDColor);
|
||||
|
||||
e.putBoolean("priority_high:enabled_led", PriorityHigh.EnableLED);
|
||||
e.putBoolean("priority_high:enabled_sound", PriorityHigh.EnableSound);
|
||||
e.putBoolean("priority_high:enabled_vibration", PriorityHigh.EnableVibration);
|
||||
e.putBoolean("priority_high:repeat_sound", PriorityHigh.RepeatSound);
|
||||
e.putString( "priority_high:sound_name", PriorityHigh.SoundName);
|
||||
e.putString( "priority_high:sound_source", PriorityHigh.SoundSource);
|
||||
e.putInt( "priority_high:led_color", PriorityHigh.LEDColor);
|
||||
|
||||
e.apply();
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import okhttp3.ResponseBody;
|
||||
|
||||
public class ServerCommunication
|
||||
{
|
||||
public static final String BASE_URL = "https://scn.blackforestbytes.com/";
|
||||
public static final String BASE_URL = /*SCNApp.LOCAL_DEBUG ? "http://localhost:1010/" : */"https://scn.blackforestbytes.com/";
|
||||
|
||||
private static final OkHttpClient client = new OkHttpClient();
|
||||
|
||||
|
@@ -1,20 +1,13 @@
|
||||
package com.blackforestbytes.simplecloudnotifier.service;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.blackforestbytes.simplecloudnotifier.R;
|
||||
import com.blackforestbytes.simplecloudnotifier.SCNApp;
|
||||
import com.blackforestbytes.simplecloudnotifier.model.CMessage;
|
||||
import com.blackforestbytes.simplecloudnotifier.model.CMessageList;
|
||||
import com.blackforestbytes.simplecloudnotifier.model.PriorityEnum;
|
||||
import com.blackforestbytes.simplecloudnotifier.model.SCNSettings;
|
||||
import com.blackforestbytes.simplecloudnotifier.view.MainActivity;
|
||||
import com.google.firebase.messaging.FirebaseMessagingService;
|
||||
import com.google.firebase.messaging.RemoteMessage;
|
||||
|
||||
|
@@ -7,13 +7,14 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import com.blackforestbytes.simplecloudnotifier.R;
|
||||
import com.blackforestbytes.simplecloudnotifier.SCNApp;
|
||||
import com.blackforestbytes.simplecloudnotifier.model.CMessage;
|
||||
import com.blackforestbytes.simplecloudnotifier.view.MainActivity;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
public class NotificationService
|
||||
{
|
||||
private final static String CHANNEL_ID = "CHAN_BFB_SCN_MESSAGES";
|
||||
|
@@ -6,8 +6,6 @@ import android.content.ClipboardManager;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -22,6 +20,9 @@ import com.blackforestbytes.simplecloudnotifier.model.SCNSettings;
|
||||
import net.glxn.qrgen.android.QRCode;
|
||||
import net.glxn.qrgen.core.image.ImageType;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
public class AccountFragment extends Fragment
|
||||
|
@@ -1,24 +1,21 @@
|
||||
package com.blackforestbytes.simplecloudnotifier.view;
|
||||
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.view.PagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
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 com.blackforestbytes.simplecloudnotifier.service.NotificationService;
|
||||
import com.google.firebase.iid.FirebaseInstanceId;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
public class MainActivity extends AppCompatActivity
|
||||
{
|
||||
|
@@ -1,19 +1,18 @@
|
||||
package com.blackforestbytes.simplecloudnotifier.view;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.blackforestbytes.simplecloudnotifier.R;
|
||||
import com.blackforestbytes.simplecloudnotifier.SCNApp;
|
||||
import com.blackforestbytes.simplecloudnotifier.model.CMessage;
|
||||
import com.blackforestbytes.simplecloudnotifier.model.CMessageList;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class MessageAdapter extends RecyclerView.Adapter
|
||||
{
|
||||
private final View vNoElements;
|
||||
|
@@ -1,17 +1,18 @@
|
||||
package com.blackforestbytes.simplecloudnotifier.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.blackforestbytes.simplecloudnotifier.R;
|
||||
import com.google.android.gms.ads.doubleclick.PublisherAdRequest;
|
||||
import com.google.android.gms.ads.doubleclick.PublisherAdView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class NotificationsFragment extends Fragment
|
||||
{
|
||||
@@ -29,6 +30,11 @@ public class NotificationsFragment extends Fragment
|
||||
rvMessages.setLayoutManager(new LinearLayoutManager(this.getContext(), RecyclerView.VERTICAL, true));
|
||||
rvMessages.setAdapter(new MessageAdapter(v.findViewById(R.id.tvNoElements)));
|
||||
|
||||
PublisherAdView mPublisherAdView = v.findViewById(R.id.adBanner);
|
||||
PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build();
|
||||
mPublisherAdView.loadAd(adRequest);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,15 +1,338 @@
|
||||
package com.blackforestbytes.simplecloudnotifier.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.blackforestbytes.simplecloudnotifier.R;
|
||||
import com.blackforestbytes.simplecloudnotifier.model.SCNSettings;
|
||||
|
||||
public class SettingsFragment extends PreferenceFragmentCompat
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import top.defaults.colorpicker.ColorPickerPopup;
|
||||
import xyz.aprildown.ultimatemusicpicker.MusicPickerListener;
|
||||
import xyz.aprildown.ultimatemusicpicker.UltimateMusicPicker;
|
||||
|
||||
public class SettingsFragment extends Fragment implements MusicPickerListener
|
||||
{
|
||||
private Switch prefAppEnabled;
|
||||
private Spinner prefLocalCacheSize;
|
||||
private Button prefUpgradeAccount;
|
||||
|
||||
private Switch prefMsgLowEnableSound;
|
||||
private TextView prefMsgLowRingtone_value;
|
||||
private View prefMsgLowRingtone_container;
|
||||
private Switch prefMsgLowRepeatSound;
|
||||
private Switch prefMsgLowEnableLED;
|
||||
private View prefMsgLowLedColor_container;
|
||||
private ImageView prefMsgLowLedColor_value;
|
||||
private Switch prefMsgLowEnableVibrations;
|
||||
|
||||
private Switch prefMsgNormEnableSound;
|
||||
private TextView prefMsgNormRingtone_value;
|
||||
private View prefMsgNormRingtone_container;
|
||||
private Switch prefMsgNormRepeatSound;
|
||||
private Switch prefMsgNormEnableLED;
|
||||
private View prefMsgNormLedColor_container;
|
||||
private ImageView prefMsgNormLedColor_value;
|
||||
private Switch prefMsgNormEnableVibrations;
|
||||
|
||||
private Switch prefMsgHighEnableSound;
|
||||
private TextView prefMsgHighRingtone_value;
|
||||
private View prefMsgHighRingtone_container;
|
||||
private Switch prefMsgHighRepeatSound;
|
||||
private Switch prefMsgHighEnableLED;
|
||||
private View prefMsgHighLedColor_container;
|
||||
private ImageView prefMsgHighLedColor_value;
|
||||
private Switch prefMsgHighEnableVibrations;
|
||||
|
||||
private int musicPickerSwitch = -1;
|
||||
|
||||
public SettingsFragment()
|
||||
{
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
View v = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||
|
||||
initFields(v);
|
||||
updateUI();
|
||||
initListener();
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
private void initFields(View v)
|
||||
{
|
||||
prefAppEnabled = v.findViewById(R.id.prefAppEnabled);
|
||||
prefLocalCacheSize = v.findViewById(R.id.prefLocalCacheSize);
|
||||
prefUpgradeAccount = v.findViewById(R.id.prefUpgradeAccount);
|
||||
|
||||
prefMsgLowEnableSound = v.findViewById(R.id.prefMsgLowEnableSound);
|
||||
prefMsgLowRingtone_value = v.findViewById(R.id.prefMsgLowRingtone_value);
|
||||
prefMsgLowRingtone_container = v.findViewById(R.id.prefMsgLowRingtone_container);
|
||||
prefMsgLowRepeatSound = v.findViewById(R.id.prefMsgLowRepeatSound);
|
||||
prefMsgLowEnableLED = v.findViewById(R.id.prefMsgLowEnableLED);
|
||||
prefMsgLowLedColor_value = v.findViewById(R.id.prefMsgLowLedColor_value);
|
||||
prefMsgLowLedColor_container = v.findViewById(R.id.prefMsgLowLedColor_container);
|
||||
prefMsgLowEnableVibrations = v.findViewById(R.id.prefMsgLowEnableVibrations);
|
||||
|
||||
prefMsgNormEnableSound = v.findViewById(R.id.prefMsgNormEnableSound);
|
||||
prefMsgNormRingtone_value = v.findViewById(R.id.prefMsgNormRingtone_value);
|
||||
prefMsgNormRingtone_container = v.findViewById(R.id.prefMsgNormRingtone_container);
|
||||
prefMsgNormRepeatSound = v.findViewById(R.id.prefMsgNormRepeatSound);
|
||||
prefMsgNormEnableLED = v.findViewById(R.id.prefMsgNormEnableLED);
|
||||
prefMsgNormLedColor_value = v.findViewById(R.id.prefMsgNormLedColor_value);
|
||||
prefMsgNormLedColor_container = v.findViewById(R.id.prefMsgNormLedColor_container);
|
||||
prefMsgNormEnableVibrations = v.findViewById(R.id.prefMsgNormEnableVibrations);
|
||||
|
||||
prefMsgHighEnableSound = v.findViewById(R.id.prefMsgHighEnableSound);
|
||||
prefMsgHighRingtone_value = v.findViewById(R.id.prefMsgHighRingtone_value);
|
||||
prefMsgHighRingtone_container = v.findViewById(R.id.prefMsgHighRingtone_container);
|
||||
prefMsgHighRepeatSound = v.findViewById(R.id.prefMsgHighRepeatSound);
|
||||
prefMsgHighEnableLED = v.findViewById(R.id.prefMsgHighEnableLED);
|
||||
prefMsgHighLedColor_value = v.findViewById(R.id.prefMsgHighLedColor_value);
|
||||
prefMsgHighLedColor_container = v.findViewById(R.id.prefMsgHighLedColor_container);
|
||||
prefMsgHighEnableVibrations = v.findViewById(R.id.prefMsgHighEnableVibrations);
|
||||
}
|
||||
|
||||
private void updateUI()
|
||||
{
|
||||
SCNSettings s = SCNSettings.inst();
|
||||
Context c = getContext();
|
||||
if (c == null) return;
|
||||
|
||||
if (prefAppEnabled.isChecked() != s.Enabled) prefAppEnabled.setChecked(s.Enabled);
|
||||
|
||||
ArrayAdapter<Integer> plcsa = new ArrayAdapter<>(c, android.R.layout.simple_spinner_item, SCNSettings.CHOOSABLE_CACHE_SIZES);
|
||||
plcsa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
prefLocalCacheSize.setAdapter(plcsa);
|
||||
prefLocalCacheSize.setSelection(getCacheSizeIndex(s.LocalCacheSize));
|
||||
|
||||
if (prefMsgLowEnableSound.isChecked() != s.PriorityLow.EnableSound) prefMsgLowEnableSound.setChecked(s.PriorityLow.EnableSound);
|
||||
if (!prefMsgLowRingtone_value.getText().equals(s.PriorityLow.SoundName)) prefMsgLowRingtone_value.setText(s.PriorityLow.SoundName);
|
||||
if (prefMsgLowRepeatSound.isChecked() != s.PriorityLow.RepeatSound) prefMsgLowRepeatSound.setChecked(s.PriorityLow.RepeatSound);
|
||||
if (prefMsgLowEnableLED.isChecked() != s.PriorityLow.EnableLED) prefMsgLowEnableLED.setChecked(s.PriorityLow.EnableLED);
|
||||
prefMsgLowLedColor_value.setColorFilter(s.PriorityLow.LEDColor);
|
||||
if (prefMsgLowEnableVibrations.isChecked() != s.PriorityLow.EnableVibration) prefMsgLowEnableVibrations.setChecked(s.PriorityLow.EnableVibration);
|
||||
|
||||
if (prefMsgNormEnableSound.isChecked() != s.PriorityNorm.EnableSound) prefMsgNormEnableSound.setChecked(s.PriorityNorm.EnableSound);
|
||||
if (!prefMsgNormRingtone_value.getText().equals(s.PriorityNorm.SoundName)) prefMsgNormRingtone_value.setText(s.PriorityNorm.SoundName);
|
||||
if (prefMsgNormRepeatSound.isChecked() != s.PriorityNorm.RepeatSound) prefMsgNormRepeatSound.setChecked(s.PriorityNorm.RepeatSound);
|
||||
if (prefMsgNormEnableLED.isChecked() != s.PriorityNorm.EnableLED) prefMsgNormEnableLED.setChecked(s.PriorityNorm.EnableLED);
|
||||
prefMsgNormLedColor_value.setColorFilter(s.PriorityNorm.LEDColor);
|
||||
if (prefMsgNormEnableVibrations.isChecked() != s.PriorityNorm.EnableVibration) prefMsgNormEnableVibrations.setChecked(s.PriorityNorm.EnableVibration);
|
||||
|
||||
if (prefMsgHighEnableSound.isChecked() != s.PriorityHigh.EnableSound) prefMsgHighEnableSound.setChecked(s.PriorityHigh.EnableSound);
|
||||
if (!prefMsgHighRingtone_value.getText().equals(s.PriorityHigh.SoundName)) prefMsgHighRingtone_value.setText(s.PriorityHigh.SoundName);
|
||||
if (prefMsgHighRepeatSound.isChecked() != s.PriorityHigh.RepeatSound) prefMsgHighRepeatSound.setChecked(s.PriorityHigh.RepeatSound);
|
||||
if (prefMsgHighEnableLED.isChecked() != s.PriorityHigh.EnableLED) prefMsgHighEnableLED.setChecked(s.PriorityHigh.EnableLED);
|
||||
prefMsgHighLedColor_value.setColorFilter(s.PriorityHigh.LEDColor);
|
||||
if (prefMsgHighEnableVibrations.isChecked() != s.PriorityHigh.EnableVibration) prefMsgHighEnableVibrations.setChecked(s.PriorityHigh.EnableVibration);
|
||||
}
|
||||
|
||||
private void initListener()
|
||||
{
|
||||
SCNSettings s = SCNSettings.inst();
|
||||
|
||||
prefAppEnabled.setOnCheckedChangeListener((a,b) -> { s.Enabled=b; saveAndUpdate(); });
|
||||
|
||||
prefLocalCacheSize.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
|
||||
{
|
||||
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
s.LocalCacheSize = prefLocalCacheSize.getSelectedItemPosition()>=0 ? SCNSettings.CHOOSABLE_CACHE_SIZES[prefLocalCacheSize.getSelectedItemPosition()] : 100;
|
||||
saveAndUpdate();
|
||||
}
|
||||
@Override public void onNothingSelected(AdapterView<?> parent) { /* */ }
|
||||
});
|
||||
|
||||
prefUpgradeAccount.setOnClickListener(a -> onUpgradeAccount());
|
||||
|
||||
prefMsgLowEnableSound.setOnCheckedChangeListener((a,b) -> { s.PriorityLow.EnableSound=b; saveAndUpdate(); });
|
||||
prefMsgLowRingtone_container.setOnClickListener(a -> chooseRingtoneLow());
|
||||
prefMsgLowRepeatSound.setOnCheckedChangeListener((a,b) -> { s.PriorityLow.RepeatSound=b; saveAndUpdate(); });
|
||||
prefMsgLowEnableLED.setOnCheckedChangeListener((a,b) -> { s.PriorityLow.EnableLED=b; saveAndUpdate(); });
|
||||
prefMsgLowLedColor_container.setOnClickListener(a -> chooseLEDColorLow());
|
||||
prefMsgLowEnableVibrations.setOnCheckedChangeListener((a,b) -> { s.PriorityLow.EnableVibration=b; saveAndUpdate(); });
|
||||
|
||||
prefMsgNormEnableSound.setOnCheckedChangeListener((a,b) -> { s.PriorityNorm.EnableSound=b; saveAndUpdate(); });
|
||||
prefMsgNormRingtone_container.setOnClickListener(a -> chooseRingtoneNorm());
|
||||
prefMsgNormRepeatSound.setOnCheckedChangeListener((a,b) -> { s.PriorityNorm.RepeatSound=b; saveAndUpdate(); });
|
||||
prefMsgNormEnableLED.setOnCheckedChangeListener((a,b) -> { s.PriorityNorm.EnableLED=b; saveAndUpdate(); });
|
||||
prefMsgNormLedColor_container.setOnClickListener(a -> chooseLEDColorNorm());
|
||||
prefMsgNormEnableVibrations.setOnCheckedChangeListener((a,b) -> { s.PriorityNorm.EnableVibration=b; saveAndUpdate(); });
|
||||
|
||||
prefMsgHighEnableSound.setOnCheckedChangeListener((a,b) -> { s.PriorityHigh.EnableSound=b; saveAndUpdate(); });
|
||||
prefMsgHighRingtone_container.setOnClickListener(a -> chooseRingtoneHigh());
|
||||
prefMsgHighRepeatSound.setOnCheckedChangeListener((a,b) -> { s.PriorityHigh.RepeatSound=b; saveAndUpdate(); });
|
||||
prefMsgHighEnableLED.setOnCheckedChangeListener((a,b) -> { s.PriorityHigh.EnableLED=b; saveAndUpdate(); });
|
||||
prefMsgHighLedColor_container.setOnClickListener(a -> chooseLEDColorHigh());
|
||||
prefMsgHighEnableVibrations.setOnCheckedChangeListener((a,b) -> { s.PriorityHigh.EnableVibration=b; saveAndUpdate(); });
|
||||
}
|
||||
|
||||
private void saveAndUpdate()
|
||||
{
|
||||
SCNSettings.inst().save();
|
||||
updateUI();
|
||||
}
|
||||
|
||||
private void onUpgradeAccount()
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
private int getCacheSizeIndex(int value)
|
||||
{
|
||||
for (int i = 0; i < SCNSettings.CHOOSABLE_CACHE_SIZES.length; i++)
|
||||
{
|
||||
if (SCNSettings.CHOOSABLE_CACHE_SIZES[i] == value) return i;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
private void chooseRingtoneLow()
|
||||
{
|
||||
musicPickerSwitch = 1;
|
||||
UltimateMusicPicker ump = new UltimateMusicPicker();
|
||||
ump.windowTitle("Choose notification sound");
|
||||
ump.removeSilent();
|
||||
ump.streamType(AudioManager.STREAM_ALARM);
|
||||
ump.ringtone();
|
||||
ump.notification();
|
||||
ump.alarm();
|
||||
ump.music();
|
||||
if (!SCNSettings.inst().PriorityLow.SoundSource.isEmpty())ump.selectUri(Uri.parse(SCNSettings.inst().PriorityLow.SoundSource));
|
||||
ump.goWithDialog(getChildFragmentManager());
|
||||
}
|
||||
|
||||
private void chooseRingtoneNorm()
|
||||
{
|
||||
musicPickerSwitch = 2;
|
||||
UltimateMusicPicker ump = new UltimateMusicPicker();
|
||||
ump.windowTitle("Choose notification sound");
|
||||
ump.removeSilent();
|
||||
ump.streamType(AudioManager.STREAM_ALARM);
|
||||
ump.ringtone();
|
||||
ump.notification();
|
||||
ump.alarm();
|
||||
ump.music();
|
||||
if (!SCNSettings.inst().PriorityNorm.SoundSource.isEmpty())ump.defaultUri(Uri.parse(SCNSettings.inst().PriorityNorm.SoundSource));
|
||||
ump.goWithDialog(getChildFragmentManager());
|
||||
}
|
||||
|
||||
private void chooseRingtoneHigh()
|
||||
{
|
||||
musicPickerSwitch = 3;
|
||||
UltimateMusicPicker ump = new UltimateMusicPicker();
|
||||
ump.windowTitle("Choose notification sound");
|
||||
ump.removeSilent();
|
||||
ump.streamType(AudioManager.STREAM_ALARM);
|
||||
ump.ringtone();
|
||||
ump.notification();
|
||||
ump.alarm();
|
||||
ump.music();
|
||||
if (!SCNSettings.inst().PriorityHigh.SoundSource.isEmpty())ump.defaultUri(Uri.parse(SCNSettings.inst().PriorityHigh.SoundSource));
|
||||
ump.goWithDialog(getChildFragmentManager());
|
||||
}
|
||||
|
||||
private void chooseLEDColorLow()
|
||||
{
|
||||
new ColorPickerPopup.Builder(getContext())
|
||||
.initialColor(SCNSettings.inst().PriorityLow.LEDColor) // Set initial color
|
||||
.enableBrightness(true) // Enable brightness slider or not
|
||||
.okTitle("Choose")
|
||||
.cancelTitle("Cancel")
|
||||
.showIndicator(true)
|
||||
.showValue(false)
|
||||
.build()
|
||||
.show(getView(), new ColorPickerPopup.ColorPickerObserver()
|
||||
{
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
|
||||
public void onColorPicked(int color) {
|
||||
SCNSettings.inst().PriorityLow.LEDColor = color;
|
||||
saveAndUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColor(int color, boolean fromUser) { }
|
||||
});
|
||||
}
|
||||
|
||||
private void chooseLEDColorNorm()
|
||||
{
|
||||
setPreferencesFromResource(R.xml.preferences, rootKey);
|
||||
new ColorPickerPopup.Builder(getContext())
|
||||
.initialColor(SCNSettings.inst().PriorityNorm.LEDColor) // Set initial color
|
||||
.enableBrightness(true) // Enable brightness slider or not
|
||||
.okTitle("Choose")
|
||||
.cancelTitle("Cancel")
|
||||
.showIndicator(true)
|
||||
.showValue(false)
|
||||
.build()
|
||||
.show(getView(), new ColorPickerPopup.ColorPickerObserver()
|
||||
{
|
||||
@Override
|
||||
public void onColorPicked(int color) {
|
||||
SCNSettings.inst().PriorityNorm.LEDColor = color;
|
||||
saveAndUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColor(int color, boolean fromUser) { }
|
||||
});
|
||||
}
|
||||
|
||||
private void chooseLEDColorHigh()
|
||||
{
|
||||
new ColorPickerPopup.Builder(getContext())
|
||||
.initialColor(SCNSettings.inst().PriorityHigh.LEDColor) // Set initial color
|
||||
.enableBrightness(true) // Enable brightness slider or not
|
||||
.okTitle("Choose")
|
||||
.cancelTitle("Cancel")
|
||||
.showIndicator(true)
|
||||
.showValue(false)
|
||||
.build()
|
||||
.show(getView(), new ColorPickerPopup.ColorPickerObserver()
|
||||
{
|
||||
@Override
|
||||
public void onColorPicked(int color) {
|
||||
SCNSettings.inst().PriorityHigh.LEDColor = color;
|
||||
saveAndUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColor(int color, boolean fromUser) { }
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMusicPick(@NotNull Uri uri, @NotNull String s)
|
||||
{
|
||||
if (musicPickerSwitch == 1) { SCNSettings.inst().PriorityLow.SoundSource =uri.toString(); SCNSettings.inst().PriorityLow.SoundName =s; saveAndUpdate(); }
|
||||
if (musicPickerSwitch == 2) { SCNSettings.inst().PriorityNorm.SoundSource=uri.toString(); SCNSettings.inst().PriorityNorm.SoundName=s; saveAndUpdate(); }
|
||||
if (musicPickerSwitch == 3) { SCNSettings.inst().PriorityHigh.SoundSource=uri.toString(); SCNSettings.inst().PriorityHigh.SoundName=s; saveAndUpdate(); }
|
||||
|
||||
musicPickerSwitch = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPickCanceled()
|
||||
{
|
||||
musicPickerSwitch = -1;
|
||||
}
|
||||
}
|
@@ -1,8 +1,8 @@
|
||||
package com.blackforestbytes.simplecloudnotifier.view;
|
||||
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
public class TabAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
|
6
android/app/src/main/res/drawable/circle.xml
Normal file
6
android/app/src/main/res/drawable/circle.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1000"
|
||||
android:viewportWidth="1000" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000"
|
||||
android:pathData="M500,500m-500,0a500,500 0,1 1,1000 0a500,500 0,1 1,-1000 0"
|
||||
android:strokeColor="#000000" android:strokeWidth="1"/>
|
||||
</vector>
|
Binary file not shown.
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 114 KiB |
@@ -6,7 +6,7 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:showIn="@layout/activity_main">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -16,7 +16,7 @@
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -26,7 +26,7 @@
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
|
@@ -7,7 +7,7 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".view.AccountFragment">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:layout_editor_absoluteY="352dp" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/loadingPanel"
|
||||
|
@@ -3,9 +3,22 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:ads="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".view.NotificationsFragment">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/pnlMessages"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/adBanner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvMessages"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -19,4 +32,20 @@
|
||||
android:text="@string/no_notifications"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<com.google.android.gms.ads.doubleclick.PublisherAdView
|
||||
android:id="@+id/adBanner"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pnlMessages"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
ads:adSize="SMART_BANNER"
|
||||
ads:adUnitId="ca-app-pub-3320562328966175/5524654300" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</FrameLayout>
|
717
android/app/src/main/res/layout/fragment_settings.xml
Normal file
717
android/app/src/main/res/layout/fragment_settings.xml
Normal file
@@ -0,0 +1,717 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ScrollView
|
||||
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:ignore="TooManyViews"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".view.SettingsFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:background="@color/colorHeader"
|
||||
android:textColor="@color/colorHeaderForeground"
|
||||
android:textSize="16sp"
|
||||
android:padding="4dp"
|
||||
android:text="@string/str_common_settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefAppEnabled"
|
||||
android:text="@string/str_enabled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLocalCacheSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/str_localcachesize"
|
||||
android:textColor="#000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/prefLocalCacheSize"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Spinner
|
||||
android:minWidth="64dp"
|
||||
android:id="@+id/prefLocalCacheSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:spinnerMode="dialog"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/prefUpgradeAccount"
|
||||
android:text="@string/str_upgrade_account"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:background="@color/colorHeader"
|
||||
android:textColor="@color/colorHeaderForeground"
|
||||
android:textSize="16sp"
|
||||
android:padding="4dp"
|
||||
android:text="@string/str_header_prio0"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgLowEnableSound"
|
||||
android:text="@string/str_msg_enablesound"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/prefMsgLowRingtone_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgLowRingtone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/str_notificationsound"
|
||||
android:textColor="#000" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/prefMsgLowRingtone_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="64dp"
|
||||
android:spinnerMode="dialog"
|
||||
android:text="Whatever"
|
||||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgLowRepeatSound"
|
||||
android:text="@string/str_repeatnotificationsound"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgLowEnableLED"
|
||||
android:text="@string/str_enable_led"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/prefMsgLowLedColor_container"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/str_ledcolor"
|
||||
android:textColor="#000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/prefMsgLowLedColor_value"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/circle"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:id="@+id/prefMsgLowLedColor_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:spinnerMode="dialog"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgLowEnableVibrations"
|
||||
android:text="@string/str_enable_vibration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:background="@color/colorHeader"
|
||||
android:textColor="@color/colorHeaderForeground"
|
||||
android:textSize="16sp"
|
||||
android:padding="4dp"
|
||||
android:text="@string/str_header_prio1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgNormEnableSound"
|
||||
android:text="@string/str_msg_enablesound"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/prefMsgNormRingtone_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgNormRingtone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/str_notificationsound"
|
||||
android:textColor="#000" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/prefMsgNormRingtone_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="64dp"
|
||||
android:spinnerMode="dialog"
|
||||
android:text="Whatever"
|
||||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgNormRepeatSound"
|
||||
android:text="@string/str_repeatnotificationsound"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgNormEnableLED"
|
||||
android:text="@string/str_enable_led"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/prefMsgNormLedColor_container"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/str_ledcolor"
|
||||
android:textColor="#000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/prefMsgNormLedColor_value"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/circle"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:id="@+id/prefMsgNormLedColor_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:spinnerMode="dialog"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgNormEnableVibrations"
|
||||
android:text="@string/str_enable_vibration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:background="@color/colorHeader"
|
||||
android:textColor="@color/colorHeaderForeground"
|
||||
android:textSize="16sp"
|
||||
android:padding="4dp"
|
||||
android:text="@string/str_header_prio2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgHighEnableSound"
|
||||
android:text="@string/str_msg_enablesound"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/prefMsgHighRingtone_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMsgHighRingtone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/str_notificationsound"
|
||||
android:textColor="#000" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/prefMsgHighRingtone_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="64dp"
|
||||
android:spinnerMode="dialog"
|
||||
android:text="Whatever"
|
||||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgHighRepeatSound"
|
||||
android:text="@string/str_repeatnotificationsound"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgHighEnableLED"
|
||||
android:text="@string/str_enable_led"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/prefMsgHighLedColor_container"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/str_ledcolor"
|
||||
android:textColor="#000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/prefMsgHighLedColor_value"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/circle"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:id="@+id/prefMsgHighLedColor_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:spinnerMode="dialog"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="#c0c0c0"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/prefMsgHighEnableVibrations"
|
||||
android:text="@string/str_enable_vibration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
@@ -4,7 +4,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -14,7 +14,7 @@
|
||||
card_view:cardCornerRadius="@dimen/card_album_radius">
|
||||
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:background="#FFFFFFFF"
|
||||
android:layout_margin="3dp"
|
||||
android:layout_width="match_parent"
|
||||
@@ -73,8 +73,8 @@
|
||||
android:paddingTop="3dp"
|
||||
android:contentDescription="@string/desc_priority_icon" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
@@ -3,6 +3,8 @@
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="colorHeader">#3F51B5</color>
|
||||
<color name="colorHeaderForeground">#FFFFFF</color>
|
||||
|
||||
<color name="colorBlack">#000</color>
|
||||
</resources>
|
||||
|
@@ -15,4 +15,17 @@
|
||||
<string name="str_not_connected">not connected</string>
|
||||
<string name="str_reload">reload</string>
|
||||
<string name="desc_priority_icon">Priority icon</string>
|
||||
<string name="str_common_settings">Common Settings</string>
|
||||
<string name="str_enabled">Enabled</string>
|
||||
<string name="str_localcachesize">Remember the last x notifications locally</string>
|
||||
<string name="str_header_prio0">Notifications (low priority)</string>
|
||||
<string name="str_header_prio1">Notifications (normal priority)</string>
|
||||
<string name="str_header_prio2">Notifications (high priority)</string>
|
||||
<string name="str_msg_enablesound">Enable notification sound</string>
|
||||
<string name="str_notificationsound">Notification sound</string>
|
||||
<string name="str_repeatnotificationsound">Repeat notification sound</string>
|
||||
<string name="str_enable_led">Enable notification light</string>
|
||||
<string name="str_ledcolor">Notification light color</string>
|
||||
<string name="str_enable_vibration">Enable notification vibration</string>
|
||||
<string name="str_upgrade_account">Upgrade account</string>
|
||||
</resources>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="@style/PreferenceFixTheme.Light.NoActionBar">
|
||||
<style name="AppTheme" parent="Theme.AppCompat.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 -->
|
||||
|
@@ -1,33 +0,0 @@
|
||||
<?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>
|
@@ -1,3 +1,3 @@
|
||||
#Sat Oct 20 02:47:36 CEST 2018
|
||||
VERSION_NAME=0.0.2
|
||||
VERSION_CODE=2
|
||||
#Sat Oct 20 18:59:02 CEST 2018
|
||||
VERSION_NAME=0.0.3
|
||||
VERSION_CODE=3
|
||||
|
@@ -9,8 +9,6 @@ buildscript {
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath 'com.google.gms:google-services:4.0.1'
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +18,9 @@ allprojects {
|
||||
jcenter()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url "https://dl.bintray.com/gericop/maven" }
|
||||
maven { url "https://maven.google.com" }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -11,3 +11,6 @@ org.gradle.jvmargs=-Xmx1536m
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
|
BIN
data/graphic.png
BIN
data/graphic.png
Binary file not shown.
Before Width: | Height: | Size: 107 KiB |
BIN
data/icon.pdn
BIN
data/icon.pdn
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 114 KiB |
Reference in New Issue
Block a user