diff --git a/android/FarmAlarm/app/build.gradle b/android/FarmAlarm/app/build.gradle index bb18181..f4a9233 100644 --- a/android/FarmAlarm/app/build.gradle +++ b/android/FarmAlarm/app/build.gradle @@ -10,6 +10,7 @@ android { versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + vectorDrawables.useSupportLibrary = true } buildTypes { release { @@ -26,5 +27,7 @@ dependencies { }) compile 'com.android.support:appcompat-v7:24.2.1' compile 'com.android.support:design:24.2.1' + compile 'com.android.support:support-v4:24.2.1' + compile 'com.android.support:support-vector-drawable:24.2.1' testCompile 'junit:junit:4.12' } diff --git a/android/FarmAlarm/app/src/main/AndroidManifest.xml b/android/FarmAlarm/app/src/main/AndroidManifest.xml index 4acbece..da2a3f7 100644 --- a/android/FarmAlarm/app/src/main/AndroidManifest.xml +++ b/android/FarmAlarm/app/src/main/AndroidManifest.xml @@ -3,6 +3,7 @@ package="com.zoblak.farmalarm"> + + + + + + + @@ -28,7 +35,16 @@ + android:exported="true" /> + + + + \ No newline at end of file diff --git a/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/AlarmNotification.java b/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/AlarmNotification.java new file mode 100644 index 0000000..28c8de1 --- /dev/null +++ b/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/AlarmNotification.java @@ -0,0 +1,136 @@ +package com.zoblak.farmalarm; + +import android.annotation.TargetApi; +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.net.Uri; +import android.os.Build; +import android.support.v4.app.NotificationCompat; + +/** + * Helper class for showing and canceling alarm + * notifications. + *

+ * This class makes heavy use of the {@link NotificationCompat.Builder} helper + * class to create notifications in a backward-compatible way. + */ +public class AlarmNotification { + /** + * The unique identifier for this type of notification. + */ + private static final String NOTIFICATION_TAG = "Alarm"; + + /** + * Shows the notification, or updates a previously shown notification of + * this type, with the given parameters. + *

+ * TODO: Customize this method's arguments to present relevant content in + * the notification. + *

+ * TODO: Customize the contents of this method to tweak the behavior and + * presentation of alarm notifications. Make + * sure to follow the + * + * Notification design guidelines when doing so. + * + * @see #cancel(Context) + */ + public static void notify(final Context context, + final String exampleString, final int number) { + final Resources res = context.getResources(); + + // This image is used as the notification's large icon (thumbnail). + // TODO: Remove this if your notification has no relevant thumbnail. + final Bitmap picture = BitmapFactory.decodeResource(res, R.drawable.example_picture); + + + final String ticker = exampleString; + final String title = res.getString( + R.string.alarm_notification_title_template, exampleString); + final String text = res.getString( + R.string.alarm_notification_placeholder_text_template, exampleString); + + final NotificationCompat.Builder builder = new NotificationCompat.Builder(context) + + // Set appropriate defaults for the notification light, sound, + // and vibration. + .setDefaults(Notification.DEFAULT_ALL) + + // Set required fields, including the small icon, the + // notification title, and text. + .setSmallIcon(R.drawable.ic_stat_alarm) + .setContentTitle(title) + .setContentText(text) + + // All fields below this line are optional. + + // Use a default priority (recognized on devices running Android + // 4.1 or later) + .setPriority(NotificationCompat.PRIORITY_DEFAULT) + + // Provide a large icon, shown with the notification in the + // notification drawer on devices running Android 3.0 or later. + .setLargeIcon(picture) + + // Set ticker text (preview) information for this notification. + .setTicker(ticker) + + // Show a number. This is useful when stacking notifications of + // a single type. + .setNumber(number) + + // If this notification relates to a past or upcoming event, you + // should set the relevant time information using the setWhen + // method below. If this call is omitted, the notification's + // timestamp will by set to the time at which it was shown. + // TODO: Call setWhen if this notification relates to a past or + // upcoming event. The sole argument to this method should be + // the notification timestamp in milliseconds. + //.setWhen(...) + + // Set the pending intent to be initiated when the user touches + // the notification. + .setContentIntent( + PendingIntent.getActivity( + context, + 0, + new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")), + PendingIntent.FLAG_UPDATE_CURRENT)) + // Automatically dismiss the notification when it is touched. + .setAutoCancel(true); + + notify(context, builder.build()); + } + + @TargetApi(Build.VERSION_CODES.ECLAIR) + private static void notify(final Context context, final Notification notification) { + final NotificationManager nm = (NotificationManager) context + .getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) { + nm.notify(NOTIFICATION_TAG, 0, notification); + } else { + nm.notify(NOTIFICATION_TAG.hashCode(), notification); + } + } + + /** + * Cancels any notifications of this type previously shown using + * {@link #notify(Context, String, int)}. + */ + @TargetApi(Build.VERSION_CODES.ECLAIR) + public static void cancel(final Context context) { + final NotificationManager nm = (NotificationManager) context + .getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) { + nm.cancel(NOTIFICATION_TAG, 0); + } else { + nm.cancel(NOTIFICATION_TAG.hashCode()); + } + } +} diff --git a/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/AppCompatPreferenceActivity.java b/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/AppCompatPreferenceActivity.java new file mode 100644 index 0000000..4d150bd --- /dev/null +++ b/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/AppCompatPreferenceActivity.java @@ -0,0 +1,109 @@ +package com.zoblak.farmalarm; + +import android.content.res.Configuration; +import android.os.Bundle; +import android.preference.PreferenceActivity; +import android.support.annotation.LayoutRes; +import android.support.annotation.Nullable; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatDelegate; +import android.support.v7.widget.Toolbar; +import android.view.MenuInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls + * to be used with AppCompat. + */ +public abstract class AppCompatPreferenceActivity extends PreferenceActivity { + + private AppCompatDelegate mDelegate; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getDelegate().installViewFactory(); + getDelegate().onCreate(savedInstanceState); + super.onCreate(savedInstanceState); + } + + @Override + protected void onPostCreate(Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + getDelegate().onPostCreate(savedInstanceState); + } + + public ActionBar getSupportActionBar() { + return getDelegate().getSupportActionBar(); + } + + public void setSupportActionBar(@Nullable Toolbar toolbar) { + getDelegate().setSupportActionBar(toolbar); + } + + @Override + public MenuInflater getMenuInflater() { + return getDelegate().getMenuInflater(); + } + + @Override + public void setContentView(@LayoutRes int layoutResID) { + getDelegate().setContentView(layoutResID); + } + + @Override + public void setContentView(View view) { + getDelegate().setContentView(view); + } + + @Override + public void setContentView(View view, ViewGroup.LayoutParams params) { + getDelegate().setContentView(view, params); + } + + @Override + public void addContentView(View view, ViewGroup.LayoutParams params) { + getDelegate().addContentView(view, params); + } + + @Override + protected void onPostResume() { + super.onPostResume(); + getDelegate().onPostResume(); + } + + @Override + protected void onTitleChanged(CharSequence title, int color) { + super.onTitleChanged(title, color); + getDelegate().setTitle(title); + } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + getDelegate().onConfigurationChanged(newConfig); + } + + @Override + protected void onStop() { + super.onStop(); + getDelegate().onStop(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + getDelegate().onDestroy(); + } + + public void invalidateOptionsMenu() { + getDelegate().invalidateOptionsMenu(); + } + + private AppCompatDelegate getDelegate() { + if (mDelegate == null) { + mDelegate = AppCompatDelegate.create(this, null); + } + return mDelegate; + } +} diff --git a/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/PeriodicalPingReceiver.java b/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/PeriodicalPingReceiver.java index 8cd1afe..64e82d9 100644 --- a/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/PeriodicalPingReceiver.java +++ b/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/PeriodicalPingReceiver.java @@ -3,6 +3,8 @@ package com.zoblak.farmalarm; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; public class PeriodicalPingReceiver extends BroadcastReceiver { public PeriodicalPingReceiver() { @@ -10,10 +12,13 @@ public class PeriodicalPingReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - // TODO: This method is called when the BroadcastReceiver is receiving - // an Intent broadcast. - throw new UnsupportedOperationException("Not yet implemented"); - AlarmPollingService.startActionPing(context, ); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + String controllers = prefs.getString("controllers", null); + Boolean isAlarmOn = prefs.getBoolean("alarm_set", false); + + if(isAlarmOn && controllers != null) { + AlarmPollingService.startActionPing(context, controllers); + } } } diff --git a/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/SettingsActivity.java b/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/SettingsActivity.java new file mode 100644 index 0000000..a65d68e --- /dev/null +++ b/android/FarmAlarm/app/src/main/java/com/zoblak/farmalarm/SettingsActivity.java @@ -0,0 +1,208 @@ +package com.zoblak.farmalarm; + + +import android.annotation.TargetApi; +import android.content.Context; +import android.content.Intent; +import android.content.res.Configuration; +import android.media.Ringtone; +import android.media.RingtoneManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.preference.ListPreference; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.support.v7.app.ActionBar; +import android.preference.PreferenceFragment; +import android.preference.PreferenceManager; +import android.preference.RingtonePreference; +import android.text.TextUtils; +import android.view.MenuItem; +import android.support.v4.app.NavUtils; + +import java.util.List; + +/** + * A {@link PreferenceActivity} that presents a set of application settings. On + * handset devices, settings are presented as a single list. On tablets, + * settings are split by category, with category headers shown to the left of + * the list of settings. + *

+ * See + * Android Design: Settings for design guidelines and the Settings + * API Guide for more information on developing a Settings UI. + */ +public class SettingsActivity extends AppCompatPreferenceActivity { + /** + * A preference value change listener that updates the preference's summary + * to reflect its new value. + */ + private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object value) { + String stringValue = value.toString(); + + if (preference instanceof ListPreference) { + // For list preferences, look up the correct display value in + // the preference's 'entries' list. + ListPreference listPreference = (ListPreference) preference; + int index = listPreference.findIndexOfValue(stringValue); + + // Set the summary to reflect the new value. + preference.setSummary( + index >= 0 + ? listPreference.getEntries()[index] + : null); + + } else if (preference instanceof RingtonePreference) { + // For ringtone preferences, look up the correct display value + // using RingtoneManager. + if (TextUtils.isEmpty(stringValue)) { + // Empty values correspond to 'silent' (no ringtone). + //preference.setSummary(R.string.pref_ringtone_silent); + + } else { + Ringtone ringtone = RingtoneManager.getRingtone( + preference.getContext(), Uri.parse(stringValue)); + + if (ringtone == null) { + // Clear the summary if there was a lookup error. + preference.setSummary(null); + } else { + // Set the summary to reflect the new ringtone display + // name. + String name = ringtone.getTitle(preference.getContext()); + preference.setSummary(name); + } + } + + } else { + // For all other preferences, set the summary to the value's + // simple string representation. + preference.setSummary(stringValue); + } + return true; + } + }; + + /** + * Helper method to determine if the device has an extra-large screen. For + * example, 10" tablets are extra-large. + */ + private static boolean isXLargeTablet(Context context) { + return (context.getResources().getConfiguration().screenLayout + & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE; + } + + /** + * Binds a preference's summary to its value. More specifically, when the + * preference's value is changed, its summary (line of text below the + * preference title) is updated to reflect the value. The summary is also + * immediately updated upon calling this method. The exact display format is + * dependent on the type of preference. + * + * @see #sBindPreferenceSummaryToValueListener + */ + private static void bindPreferenceSummaryToValue(Preference preference) { + // Set the listener to watch for value changes. + preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener); + + // Trigger the listener immediately with the preference's + // current value. + sBindPreferenceSummaryToValueListener.onPreferenceChange(preference, + PreferenceManager + .getDefaultSharedPreferences(preference.getContext()) + .getString(preference.getKey(), "")); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setupActionBar(); + } + + /** + * Set up the {@link android.app.ActionBar}, if the API is available. + */ + private void setupActionBar() { + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + // Show the Up button in the action bar. + actionBar.setDisplayHomeAsUpEnabled(true); + } + } + + @Override + public boolean onMenuItemSelected(int featureId, MenuItem item) { + int id = item.getItemId(); + if (id == android.R.id.home) { + if (!super.onMenuItemSelected(featureId, item)) { + NavUtils.navigateUpFromSameTask(this); + } + return true; + } + return super.onMenuItemSelected(featureId, item); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean onIsMultiPane() { + return isXLargeTablet(this); + } + + /** + * {@inheritDoc} + */ + @Override + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public void onBuildHeaders(List

target) { + loadHeadersFromResource(R.xml.pref_headers, target); + } + + /** + * This method stops fragment injection in malicious applications. + * Make sure to deny any unknown fragments here. + */ + protected boolean isValidFragment(String fragmentName) { + return PreferenceFragment.class.getName().equals(fragmentName) + || GeneralPreferenceFragment.class.getName().equals(fragmentName); + } + + /** + * This fragment shows general preferences only. It is used when the + * activity is showing a two-pane settings UI. + */ + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public static class GeneralPreferenceFragment extends PreferenceFragment { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.pref_general); + setHasOptionsMenu(true); + + // Bind the summaries of EditText/List/Dialog/Ringtone preferences + // to their values. When their values change, their summaries are + // updated to reflect the new value, per the Android Design + // guidelines. + bindPreferenceSummaryToValue(findPreference("alarm_set")); + bindPreferenceSummaryToValue(findPreference("controllers")); + bindPreferenceSummaryToValue(findPreference("period_minutes")); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + if (id == android.R.id.home) { + startActivity(new Intent(getActivity(), SettingsActivity.class)); + return true; + } + return super.onOptionsItemSelected(item); + } + } + + +} diff --git a/android/FarmAlarm/app/src/main/res/drawable-hdpi-v11/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-hdpi-v11/ic_stat_alarm.png new file mode 100644 index 0000000..40a2167 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-hdpi-v11/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-hdpi-v9/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-hdpi-v9/ic_stat_alarm.png new file mode 100644 index 0000000..4dcdc9a Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-hdpi-v9/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_action_stat_reply.png b/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_action_stat_reply.png new file mode 100644 index 0000000..835d96f Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_action_stat_reply.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_action_stat_share.png b/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_action_stat_share.png new file mode 100644 index 0000000..c329f58 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_action_stat_share.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_stat_alarm.png new file mode 100644 index 0000000..bf7d62d Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-hdpi/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-mdpi-v11/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-mdpi-v11/ic_stat_alarm.png new file mode 100644 index 0000000..c4c0255 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-mdpi-v11/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-mdpi-v9/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-mdpi-v9/ic_stat_alarm.png new file mode 100644 index 0000000..94c2887 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-mdpi-v9/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_action_stat_reply.png b/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_action_stat_reply.png new file mode 100644 index 0000000..9e34465 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_action_stat_reply.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_action_stat_share.png b/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_action_stat_share.png new file mode 100644 index 0000000..056deb5 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_action_stat_share.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_stat_alarm.png new file mode 100644 index 0000000..73543d1 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-mdpi/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-nodpi/example_picture.png b/android/FarmAlarm/app/src/main/res/drawable-nodpi/example_picture.png new file mode 100644 index 0000000..e0627f5 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-nodpi/example_picture.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-xhdpi-v11/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-xhdpi-v11/ic_stat_alarm.png new file mode 100644 index 0000000..024b074 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-xhdpi-v11/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-xhdpi-v9/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-xhdpi-v9/ic_stat_alarm.png new file mode 100644 index 0000000..38b16f2 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-xhdpi-v9/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_action_stat_reply.png b/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_action_stat_reply.png new file mode 100644 index 0000000..4cc854a Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_action_stat_reply.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_action_stat_share.png b/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_action_stat_share.png new file mode 100644 index 0000000..15549b0 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_action_stat_share.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_stat_alarm.png new file mode 100644 index 0000000..4c6cc9f Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-xhdpi/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-xxhdpi-v11/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-xxhdpi-v11/ic_stat_alarm.png new file mode 100644 index 0000000..fe5416e Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-xxhdpi-v11/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-xxhdpi-v9/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-xxhdpi-v9/ic_stat_alarm.png new file mode 100644 index 0000000..a49f0d8 Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-xxhdpi-v9/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable-xxhdpi/ic_stat_alarm.png b/android/FarmAlarm/app/src/main/res/drawable-xxhdpi/ic_stat_alarm.png new file mode 100644 index 0000000..07c0ecc Binary files /dev/null and b/android/FarmAlarm/app/src/main/res/drawable-xxhdpi/ic_stat_alarm.png differ diff --git a/android/FarmAlarm/app/src/main/res/drawable/ic_info_black_24dp.xml b/android/FarmAlarm/app/src/main/res/drawable/ic_info_black_24dp.xml new file mode 100644 index 0000000..34b8202 --- /dev/null +++ b/android/FarmAlarm/app/src/main/res/drawable/ic_info_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/android/FarmAlarm/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/android/FarmAlarm/app/src/main/res/drawable/ic_notifications_black_24dp.xml new file mode 100644 index 0000000..e3400cf --- /dev/null +++ b/android/FarmAlarm/app/src/main/res/drawable/ic_notifications_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/android/FarmAlarm/app/src/main/res/drawable/ic_sync_black_24dp.xml b/android/FarmAlarm/app/src/main/res/drawable/ic_sync_black_24dp.xml new file mode 100644 index 0000000..5a283aa --- /dev/null +++ b/android/FarmAlarm/app/src/main/res/drawable/ic_sync_black_24dp.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/android/FarmAlarm/app/src/main/res/layout/fragment_main_screen.xml b/android/FarmAlarm/app/src/main/res/layout/fragment_main_screen.xml index 6f8e232..323667d 100644 --- a/android/FarmAlarm/app/src/main/res/layout/fragment_main_screen.xml +++ b/android/FarmAlarm/app/src/main/res/layout/fragment_main_screen.xml @@ -14,6 +14,8 @@ + android:id="@+id/main_web_view" + android:partition="persist:browser" + > diff --git a/android/FarmAlarm/app/src/main/res/values/strings.xml b/android/FarmAlarm/app/src/main/res/values/strings.xml index 7a07305..b1dce71 100644 --- a/android/FarmAlarm/app/src/main/res/values/strings.xml +++ b/android/FarmAlarm/app/src/main/res/values/strings.xml @@ -1,4 +1,39 @@ Farm Alarm Settings + Podešavanje + + + + + Generalno + + + Add friends to messages + + Always + When possible + Never + + + 1 + 0 + -1 + + + Alarm: %1$s + + + You said %1$s and lorem ipsum dolor + sit amet, consectetur adipiscing elit. Etiam non enim magna. Morbi dictum, velit vel semper + venenatis, magna odio volutpat velit, at ullamcorper nulla lacus sed turpis. Pellentesque + vitae metus elit, nec tincidunt tellus. Integer sed nisl sem, ullamcorper ornare lacus. Duis + ac mauris sed massa congue volutpat. Donec sed erat sit amet turpis viverra rhoncus sit amet + nec magna. Donec lacinia ligula at libero volutpat volutpat nec nec tortor. + + + Share + Reply + + diff --git a/android/FarmAlarm/app/src/main/res/xml/pref_general.xml b/android/FarmAlarm/app/src/main/res/xml/pref_general.xml new file mode 100644 index 0000000..07c3663 --- /dev/null +++ b/android/FarmAlarm/app/src/main/res/xml/pref_general.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/android/FarmAlarm/app/src/main/res/xml/pref_headers.xml b/android/FarmAlarm/app/src/main/res/xml/pref_headers.xml new file mode 100644 index 0000000..89ff289 --- /dev/null +++ b/android/FarmAlarm/app/src/main/res/xml/pref_headers.xml @@ -0,0 +1,10 @@ + + + + +
+ +