From 3f4022402d3737a398ada6c5256eddb46d15c22a Mon Sep 17 00:00:00 2001 From: BedrockDev Date: Sun, 11 Jun 2017 01:55:12 +0900 Subject: [PATCH] Working on #59 --- .../bedrock/padder/activity/HelpActivity.java | 78 +++++++++++++++++-- app/src/main/res/layout/activity_help.xml | 41 ++++++++-- app/src/main/res/values/strings.xml | 18 ++++- 3 files changed, 121 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/bedrock/padder/activity/HelpActivity.java b/app/src/main/java/com/bedrock/padder/activity/HelpActivity.java index 764b1fe..ba2592c 100644 --- a/app/src/main/java/com/bedrock/padder/activity/HelpActivity.java +++ b/app/src/main/java/com/bedrock/padder/activity/HelpActivity.java @@ -2,10 +2,12 @@ import android.os.Bundle; import android.support.v7.app.AppCompatActivity; -import android.view.KeyEvent; import android.view.MenuItem; +import android.widget.TextView; import com.bedrock.padder.R; +import com.bedrock.padder.helper.AnimateHelper; +import com.bedrock.padder.helper.IntentHelper; import com.bedrock.padder.helper.ToolbarHelper; import com.bedrock.padder.helper.WindowHelper; @@ -15,12 +17,22 @@ public class HelpActivity extends AppCompatActivity { private WindowHelper window = new WindowHelper(); private ToolbarHelper toolbar = new ToolbarHelper(); + private IntentHelper intent = new IntentHelper(); + private AnimateHelper anim = new AnimateHelper(); + + private TextView detailTitle; + private TextView detailText; + + private boolean isDetailVisible = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_help); + detailTitle = window.getTextView(R.id.activity_help_detail_title, activity); + detailText = window.getTextView(R.id.activity_help_detail_text, activity); + setUi(); } @@ -38,10 +50,56 @@ private void setUi() { // set taskDesc window.setRecentColor(R.string.help_title, R.color.colorAccent, activity); + + setActions(); + } + + private void setActions() { + window.setOnClick(R.id.activity_help_contact_email, new Runnable() { + @Override + public void run() { + intent.intentEmail(activity, R.string.feedback_email, + "Tapad Feedback - Feedback [Email]", null, + R.string.feedback_email_client_feedback, 0); + } + }, activity); + window.setOnClick(R.id.activity_help_contact_send_feedback, new Runnable() { + @Override + public void run() { + intent.intentWithExtra(activity, "activity.FeedbackActivity", "feedbackMode", "feedback", 0); + } + }, activity); + + String helpItems[] = { + "about_tapad", + "about_gesture_mode", + "preset_store_download", + "preset_store_manage", + "tutorial" + }; + + for (final String helpItem : helpItems) { + // set onclick items + window.setOnClick(window.getId("activity_help_popular_" + helpItem), new Runnable() { + @Override + public void run() { + showDetailHelp(helpItem); + } + }, activity); + } + } + + private void showDetailHelp(String helpResId) { + if (!isDetailVisible) { + isDetailVisible = true; + detailTitle.setText(window.getStringFromId("help_popular_" + helpResId, activity)); + detailText.setText(window.getStringFromId("help_popular_" + helpResId + "_detail", activity)); + anim.fadeIn(R.id.activity_help_detail, 0, 200, "detailIn", activity); + } } public boolean onOptionsItemSelected(MenuItem item) { - pressBack(); + finish(); return true; } @@ -50,14 +108,18 @@ public void onWindowFocusChanged(boolean hasFocus) { if (hasFocus) { // reset taskDesc - window.setRecentColor(window.getStringFromId("help_title", activity), R.color.colorAccent, activity); + window.setRecentColor(R.string.help_title, R.color.colorAccent, activity); } } - void pressBack() { - KeyEvent kDown = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK); - activity.dispatchKeyEvent(kDown); - KeyEvent kUp = new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK); - activity.dispatchKeyEvent(kUp); + @Override + public void onBackPressed() { + if (isDetailVisible) { + // visible, close detail + anim.fadeOut(R.id.activity_help_detail, 0, 200, activity); + isDetailVisible = false; + } else { + super.onBackPressed(); + } } } diff --git a/app/src/main/res/layout/activity_help.xml b/app/src/main/res/layout/activity_help.xml index 70e25ac..ca9ff27 100644 --- a/app/src/main/res/layout/activity_help.xml +++ b/app/src/main/res/layout/activity_help.xml @@ -28,7 +28,7 @@ android:orientation="vertical" android:paddingBottom="8dp" android:paddingTop="8dp" - android:translationZ="2dp"> + android:elevation="2dp"> + android:elevation="2dp"> + android:paddingTop="14dp"> + android:textSize="14sp"/> + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4b48a70..a93c9eb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -48,11 +48,25 @@ Popular About Tapad - Play a gesture preset + About gesture mode Download new presets - View & delete presets + View & delete installed presets Learn to play Tapad + + Tapad is a mobile remix application. \n\n + Extended from the instrument LaunchPad, and made mobile friendly with touch gesture support. + It mainly features song genres like EDM, Dubstep, Progressive House, Electronic and further more. + + + Gesture mode is a new feature in Tapad. \n + In gesture mode, you can swipe in 4 directions and press a pad. Gesture presets have different sounds playing on these 5 actions. + LaunchPad and other applications have 1 input / pad. But Tapad have gesture mode to get maximum 5 input / pad. + + Download new presets + View & delete presets + Learn to play Tapad + Browse all articles