This repository has been archived by the owner on Feb 17, 2020. It is now read-only.
SQ-55/notifications settings #136
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e84b272
Create SettingsActivity
danybony 7845fc9
Merge branch 'SQ-55/feature_branch' into SQ-55/settings
danybony f372f04
Create SettingsFragment
danybony f1c406d
Add SettingsFragment into activity
danybony e5fc1ae
Add settings menu icon with navigation from schedule
danybony 720fde5
Add settings icon vector
danybony 2c09834
Add toolbar to Settings activity
danybony d429e7c
Check for preferences status before showing notifications
danybony ac264c1
Revormat SchedulePageView
danybony de221c5
Update settings icon
danybony File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/src/main/java/net/squanchy/settings/SettingsActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.squanchy.settings; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.MenuItem; | ||
|
||
import net.squanchy.R; | ||
import net.squanchy.fonts.TypefaceStyleableActivity; | ||
|
||
public class SettingsActivity extends TypefaceStyleableActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
setContentView(R.layout.activity_settings); | ||
|
||
setupToolbar(); | ||
|
||
getFragmentManager().beginTransaction() | ||
.replace(R.id.fragment_container, new SettingsFragment()) | ||
.commit(); | ||
} | ||
|
||
private void setupToolbar() { | ||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
setSupportActionBar(toolbar); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
if (item.getItemId() == android.R.id.home) { | ||
finish(); | ||
return true; | ||
} | ||
return super.onOptionsItemSelected(item); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/net/squanchy/settings/SettingsFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package net.squanchy.settings; | ||
|
||
import android.os.Bundle; | ||
import android.preference.PreferenceFragment; | ||
|
||
import net.squanchy.R; | ||
|
||
public class SettingsFragment extends PreferenceFragment { | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
addPreferencesFromResource(R.xml.settings_preferences); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
|
||
<path | ||
android:fillColor="?colorControlNormal" | ||
android:pathData="M20.574 13.893c-.07-.337-.434-2.013-.673-2.124-.093-.043-.475-.067-.93-.08a7.966 7.966 0 0 0-.3-2.95A9.974 9.974 0 0 1 8.26 4.77c-.981 2.391-2.851 4.321-5.211 5.371-.03.28-.05.57-.05.86 0 4.41 3.59 8 8 8 .264 0 .526-.013.783-.038.056.439.574 1.598.723 1.925-.491.074-.994.113-1.506.113-5.52 0-10-4.48-10-10S5.48 1 11 1s10 4.48 10 10a9.99 9.99 0 0 1-.426 2.893zM14 10.75a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5zm-6 0a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z" /> | ||
|
||
<path | ||
android:fillColor="?colorControlNormal" | ||
android:pathData="M21.715 18.49c.02-.16.035-.32.035-.49 0-.17-.015-.33-.035-.49l1.055-.825a.252.252 0 0 0 .06-.32l-1-1.73c-.06-.11-.195-.15-.305-.11l-1.245.5c-.26-.2-.54-.365-.845-.49l-.19-1.325A.244.244 0 0 0 19 13h-2c-.125 0-.23.09-.245.21l-.19 1.325a3.841 3.841 0 0 0-.845.49l-1.245-.5a.244.244 0 0 0-.305.11l-1 1.73a.247.247 0 0 0 .06.32l1.055.825c-.02.16-.035.325-.035.49 0 .165.015.33.035.49l-1.055.825a.252.252 0 0 0-.06.32l1 1.73c.06.11.195.15.305.11l1.245-.5c.26.2.54.365.845.49l.19 1.325c.015.12.12.21.245.21h2c.125 0 .23-.09.245-.21l.19-1.325c.305-.125.585-.295.845-.49l1.245.5c.115.045.245 0 .305-.11l1-1.73a.252.252 0 0 0-.06-.32l-1.055-.825zM18 19.75c-.965 0-1.75-.785-1.75-1.75s.785-1.75 1.75-1.75 1.75.785 1.75 1.75-.785 1.75-1.75 1.75z" /> | ||
|
||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout 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" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context="net.squanchy.settings.settings.SettingsActivity"> | ||
|
||
<android.support.design.widget.AppBarLayout | ||
style="@style/Squanchy.Appbar" | ||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> | ||
|
||
</android.support.design.widget.AppBarLayout> | ||
|
||
<FrameLayout | ||
android:id="@+id/fragment_container" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<item | ||
android:id="@+id/action_settings" | ||
android:title="@string/settings_label" | ||
android:icon="@drawable/ic_settings" | ||
app:showAsAction="ifRoom" /> | ||
|
||
<item | ||
android:id="@+id/action_search" | ||
android:title="@string/search_label" | ||
android:icon="@drawable/ic_search" | ||
app:showAsAction="ifRoom" /> | ||
|
||
</menu> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<string name="about_to_start_notification_preference_key">about_to_start_notification__preference_key</string> | ||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<PreferenceCategory android:title="@string/settings_notifications_category"> | ||
|
||
<SwitchPreference | ||
android:defaultValue="true" | ||
android:key="@string/about_to_start_notification_preference_key" | ||
android:title="@string/settings_notifications_about_to_start_title" | ||
android:summaryOn="@string/settings_notifications_about_to_start_summary_on" | ||
android:summaryOff="@string/settings_notifications_about_to_start_summary_off" /> | ||
|
||
</PreferenceCategory> | ||
|
||
</PreferenceScreen> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could've put the
<fragment ... />
here directly I suppose, but whatevs