Add resources menu
parent
cbabb02d82
commit
170e079cb7
|
@ -1,4 +1,5 @@
|
|||
1.5.9:
|
||||
- Add resources menu linking to how to meditate, /r/meditation and replaying the tutorial
|
||||
- Resolve possible crash when waking device
|
||||
- Remove usage of Google Play Services (was previously used in releases on Google Play and Amazon)
|
||||
|
||||
|
|
|
@ -117,10 +117,6 @@ public class AboutActivity extends Activity {
|
|||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(MeditationAssistant.URL_SOURCE)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}
|
||||
|
||||
public void openHowToMeditate(View view) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(MeditationAssistant.URL_MEDINET + "/howtomeditate")).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}
|
||||
|
||||
public void openTranslate(View view) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(MeditationAssistant.URL_MEDINET + "/translate")).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}
|
||||
|
|
|
@ -426,7 +426,7 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
|
|||
dialogClickListener).show();
|
||||
}
|
||||
|
||||
showNextTutorial();
|
||||
showNextTutorial(false);
|
||||
getMeditationAssistant().recalculateMeditationStreak(MainActivity.this);
|
||||
|
||||
long pref_delay = Integer.valueOf(getMeditationAssistant().getPrefs().getString("pref_delay", "-1"));
|
||||
|
@ -463,9 +463,6 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
|
|||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
if (sv != null && sv.isShown()) {
|
||||
try {
|
||||
sv.hide();
|
||||
|
@ -474,7 +471,15 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
|
|||
}
|
||||
}
|
||||
|
||||
if (item.getItemId() == R.id.action_settings) {
|
||||
if (item.getItemId() == R.id.action_how_to_meditate) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(MeditationAssistant.URL_MEDINET + "/howtomeditate")).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
} else if (item.getItemId() == R.id.action_reddit_community) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://old.reddit.com/r/meditation")).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
} else if (item.getItemId() == R.id.action_replay_tutorial) {
|
||||
finishedTutorial = null;
|
||||
getMeditationAssistant().getPrefs().edit().putBoolean("finishedTutorial", false).apply();
|
||||
showNextTutorial(true);
|
||||
} else if (item.getItemId() == R.id.action_settings) {
|
||||
Intent intent = new Intent(this, SettingsActivity.class);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
|
@ -635,15 +640,15 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
|
|||
updateVisibleViews(false);
|
||||
|
||||
if (wasEditing) {
|
||||
showNextTutorial();
|
||||
showNextTutorial(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void showNextTutorial() {
|
||||
private void showNextTutorial(boolean force) {
|
||||
if (finishedTutorial == null) {
|
||||
finishedTutorial = getMeditationAssistant().getPrefs().getBoolean("finishedTutorial", false);
|
||||
|
||||
if (!finishedTutorial && getMeditationAssistant().db.getNumSessions() > 0) { // Already recorded a session
|
||||
if (!finishedTutorial && getMeditationAssistant().db.getNumSessions() > 0 && !force) { // Already recorded a session
|
||||
getMeditationAssistant().getPrefs().edit().putBoolean("finishedTutorial", true).apply();
|
||||
finishedTutorial = true;
|
||||
}
|
||||
|
@ -1644,7 +1649,7 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
|
|||
}
|
||||
}
|
||||
|
||||
showNextTutorial();
|
||||
showNextTutorial(false);
|
||||
|
||||
super.onResume();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M18,2H6c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zM6,4h5v8l-2.5,-1.5L6,12V4z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M18,2H6c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zM6,4h5v8l-2.5,-1.5L6,12V4z"/>
|
||||
</vector>
|
|
@ -1,8 +1,8 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
android:focusable="false">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
android:focusable="false">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -23,8 +23,8 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="21dp"
|
||||
android:layout_marginTop="21dp"
|
||||
android:layout_marginBottom="21dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:gravity="center"
|
||||
|
@ -37,16 +37,24 @@
|
|||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="28sp"/>
|
||||
android:textSize="28sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtAboutAppVersion"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:layout_marginBottom="18dp"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:gravity="center"
|
||||
android:text="Created by Trevor Slocum\ntrevor@rocketnine.space"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -74,39 +82,39 @@
|
|||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:text="@string/tapToLearnMore"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:background="?android:attr/listDivider"/>
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnHowToMeditate"
|
||||
android:id="@+id/btnLearnMore"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:onClick="openHowToMeditate"
|
||||
android:paddingBottom="7dp"
|
||||
android:onClick="learnMore"
|
||||
android:paddingTop="7dp"
|
||||
android:text="@string/howToMeditate"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
android:paddingBottom="7dp"
|
||||
android:text="@string/sourceRepository"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:background="?android:attr/listDivider"/>
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/divMainControls"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/divMainControls"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
|
@ -116,18 +124,18 @@
|
|||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:onClick="openTranslate"
|
||||
android:paddingBottom="7dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="7dp"
|
||||
android:text="@string/translate"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divDonate"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginBottom="7dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:background="?android:attr/listDivider"/>
|
||||
android:layout_marginBottom="7dp"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnDonate"
|
||||
|
@ -136,10 +144,10 @@
|
|||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:onClick="openDonate"
|
||||
android:paddingBottom="7dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="7dp"
|
||||
android:text="@string/donate"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
@ -153,12 +161,12 @@
|
|||
android:id="@+id/charis"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/charis"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/charis"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,10 +1,29 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_resources"
|
||||
android:icon="?attr/actionIconResources"
|
||||
android:orderInCategory="100"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/resources">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/action_how_to_meditate"
|
||||
android:title="@string/howToMeditate" />
|
||||
<item
|
||||
android:id="@+id/action_reddit_community"
|
||||
android:title="@string/meditationSubreddit" />
|
||||
<item
|
||||
android:id="@+id/action_replay_tutorial"
|
||||
android:title="@string/replayTutorial" />
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="?attr/actionIconSettings"
|
||||
android:orderInCategory="100"
|
||||
android:orderInCategory="101"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/settings"/>
|
||||
android:title="@string/settings" />
|
||||
|
||||
</menu>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<attr name="actionIconVolumeOn" format="reference"/>
|
||||
<attr name="actionIconNotImportant" format="reference"/>
|
||||
<attr name="actionIconInfo" format="reference"/>
|
||||
<attr name="actionIconResources" format="reference"/>
|
||||
<attr name="actionIconSettings" format="reference"/>
|
||||
<attr name="actionIconNetworkCell" format="reference"/>
|
||||
<attr name="actionIconBrightnessLow" format="reference"/>
|
||||
|
|
|
@ -61,6 +61,10 @@
|
|||
<string name="untimed">Untimed</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="presetLabelEndAt">End %s</string>
|
||||
<string name="resources">Resources</string>
|
||||
<string name="howToMeditate">How to meditate</string>
|
||||
<string name="meditationSubreddit">Reddit community</string>
|
||||
<string name="replayTutorial">Replay tutorial</string>
|
||||
<!-- About -->
|
||||
<string name="tapToLearnMore">Tap anywhere to learn more</string>
|
||||
<string name="sendEmail">Send email</string>
|
||||
|
@ -68,8 +72,8 @@
|
|||
<string name="translate">Translate</string>
|
||||
<string name="donate">Donate</string>
|
||||
<string name="chooseDonationMethod">Please choose how you would like to donate.\n\nLiberapay is preferred by the developer and supports more countries and currencies.</string>
|
||||
<string name="howToMeditate">How to Meditate</string>
|
||||
<string name="share">Share</string>
|
||||
<string name="sourceRepository">Source Code Repository</string>
|
||||
<!--Short text displayed in sent application invitations [CHAR LIMIT=100] -->
|
||||
<string name="invitationBlurb">Meditation Assistant is a fully featured companion to your practice.</string>
|
||||
<!-- Sessions -->
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<item name="actionIconVolumeOn">@drawable/ic_action_volume_on_light</item>
|
||||
<item name="actionIconNotImportant">@drawable/ic_action_not_important_light</item>
|
||||
<item name="actionIconInfo">@drawable/ic_action_info_light</item>
|
||||
<item name="actionIconResources">@drawable/ic_book_black_24dp</item>
|
||||
<item name="actionIconSettings">@drawable/ic_action_settings_light</item>
|
||||
<item name="actionIconNetworkCell">@drawable/ic_action_network_cell_light</item>
|
||||
<item name="actionIconBrightnessLow">@drawable/ic_action_brightness_low_light</item>
|
||||
|
@ -73,6 +74,7 @@
|
|||
<!-- Used in action bars -->
|
||||
<item name="actionIconNotImportant">@drawable/ic_action_not_important</item>
|
||||
<item name="actionIconInfo">@drawable/ic_action_info</item>
|
||||
<item name="actionIconResources">@drawable/ic_book_white_24dp</item>
|
||||
<item name="actionIconSettings">@drawable/ic_action_settings</item>
|
||||
<item name="actionIconAccounts">@drawable/ic_action_accounts</item>
|
||||
<item name="actionIconRefresh">@drawable/ic_action_refresh</item>
|
||||
|
@ -96,6 +98,7 @@
|
|||
<item name="actionIconVolumeOn">@drawable/ic_action_volume_on</item>
|
||||
<item name="actionIconNotImportant">@drawable/ic_action_not_important</item>
|
||||
<item name="actionIconInfo">@drawable/ic_action_info</item>
|
||||
<item name="actionIconResources">@drawable/ic_book_white_24dp</item>
|
||||
<item name="actionIconSettings">@drawable/ic_action_settings</item>
|
||||
<item name="actionIconNetworkCell">@drawable/ic_action_network_cell</item>
|
||||
<item name="actionIconBrightnessLow">@drawable/ic_action_brightness_low</item>
|
||||
|
@ -130,6 +133,7 @@
|
|||
<item name="actionIconVolumeOn">@drawable/ic_action_volume_on_light</item>
|
||||
<item name="actionIconNotImportant">@drawable/ic_action_not_important_light</item>
|
||||
<item name="actionIconInfo">@drawable/ic_action_info_light</item>
|
||||
<item name="actionIconResources">@drawable/ic_book_black_24dp</item>
|
||||
<item name="actionIconSettings">@drawable/ic_action_settings_light</item>
|
||||
<item name="actionIconNetworkCell">@drawable/ic_action_network_cell_light</item>
|
||||
<item name="actionIconBrightnessLow">@drawable/ic_action_brightness_low_light</item>
|
||||
|
@ -159,6 +163,7 @@
|
|||
<item name="actionIconVolumeOn">@drawable/ic_action_volume_on</item>
|
||||
<item name="actionIconNotImportant">@drawable/ic_action_not_important</item>
|
||||
<item name="actionIconInfo">@drawable/ic_action_info</item>
|
||||
<item name="actionIconResources">@drawable/ic_book_white_24dp</item>
|
||||
<item name="actionIconSettings">@drawable/ic_action_settings</item>
|
||||
<item name="actionIconNetworkCell">@drawable/ic_action_network_cell</item>
|
||||
<item name="actionIconBrightnessLow">@drawable/ic_action_brightness_low</item>
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
<item name="actionIconVolumeOn">@drawable/ic_action_volume_on</item>
|
||||
<item name="actionIconNotImportant">@drawable/ic_action_not_important</item>
|
||||
<item name="actionIconInfo">@drawable/ic_action_info</item>
|
||||
<item name="actionIconResources">@drawable/ic_book_white_24dp</item>
|
||||
<item name="actionIconSettings">@drawable/ic_action_settings</item>
|
||||
<item name="actionIconNetworkCell">@drawable/ic_action_network_cell</item>
|
||||
<item name="actionIconBrightnessLow">@drawable/ic_action_brightness_low</item>
|
||||
|
|
Loading…
Reference in New Issue