Add token script question and answer

pull/1406/head
ChintanRathod 5 years ago
parent 9dd0542ece
commit 1b2dc0d054
  1. 4
      app/src/main/assets/tokenscript_explaination.html
  2. 45
      app/src/main/java/com/alphawallet/app/ui/HelpActivity.java
  3. 3
      app/src/main/java/com/alphawallet/app/ui/widget/holder/HelpHolder.java
  4. 2
      app/src/main/res/layout/fragment_help.xml
  5. 2
      app/src/main/res/values-es/strings.xml
  6. 2
      app/src/main/res/values-zh/strings.xml
  7. 2
      app/src/main/res/values/strings.xml

@ -0,0 +1,4 @@
<p>
TokenScript is a markup language which aims to provide a enhanced experience for token users and owners. The experience is enhanced with a cryptographic trust model and consistent user interface. A TokenScript associated with a token provides a user with a trusted and private way to use more advanced features; for example 'approve' on ERC20 or 'breedWithAuto' on Cryptokitties.
Further on <a href="https://tokenscript.org/community/">Tokenscript community page</a>
</p>

@ -8,6 +8,7 @@ import android.support.annotation.RawRes;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebView;
import android.widget.LinearLayout;
@ -53,7 +54,8 @@ public class HelpActivity extends BaseActivity {
R.string.help_question2,
R.string.help_question3,
R.string.help_question4,
R.string.help_question5
R.string.help_question5,
R.string.help_question6
};
int[] answers = {
@ -61,14 +63,17 @@ public class HelpActivity extends BaseActivity {
R.string.why_alphawallet_eth,
R.string.how_i_get_money,
R.string.what_is_seed_phrase,
R.string.how_i_transfer_into_wallet
R.string.how_i_transfer_into_wallet,
R.string.tokenscript_explaination,
};
adapter.setWebView(webView);
List<HelpItem> helpItems = new ArrayList<>();
for (int i = 0; i < questions.length; i++) {
if (isRawResource(answers[i])) helpItems.add(new HelpItem(getString(questions[i]), answers[i]));
else if (getString(questions[i]).length() > 0) helpItems.add(new HelpItem(getString(questions[i]), getString(answers[i])));
if (isRawResource(answers[i]))
helpItems.add(new HelpItem(getString(questions[i]), answers[i]));
else if (getString(questions[i]).length() > 0)
helpItems.add(new HelpItem(getString(questions[i]), getString(answers[i])));
}
adapter.setHelpItems(helpItems);
@ -80,8 +85,33 @@ public class HelpActivity extends BaseActivity {
});
}
private void helpIntent()
{
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
if (hideWebView()) {
super.onOptionsItemSelected(item);
}
}
return true;
}
@Override
public void onBackPressed() {
if (hideWebView()) {
super.onBackPressed();
}
}
private boolean hideWebView() {
if (webView.getVisibility() == View.VISIBLE) {
webView.setVisibility(View.GONE);
return false;
}
return true;
}
private void helpIntent() {
final String at = "@";
String uriText =
"mailto:" + MediaLinks.AWALLET_EMAIL1 + at + MediaLinks.AWALLET_EMAIL2 +
@ -142,8 +172,7 @@ public class HelpActivity extends BaseActivity {
private boolean isRawResource(@RawRes int rawRes) {
try {
InputStream in = getResources().openRawResource(rawRes);
if (in.available() > 0)
{
if (in.available() > 0) {
in.close();
return true;
}

@ -52,6 +52,9 @@ public class HelpHolder extends BinderViewHolder<HelpItem> implements View.OnCli
if (helpItem.getResource() > 0) rawResource = helpItem.getResource();
else answerText.setText(helpItem.getAnswer());
answerLayout.setVisibility(View.GONE);
webView.setVisibility(View.GONE);
LinearLayout container = findViewById(R.id.item_help);
container.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);

@ -15,6 +15,8 @@
android:divider="@android:color/transparent"
android:dividerHeight="10.0sp"
android:paddingLeft="10dp"
android:layout_above="@id/layout_contact"
android:layout_alignParentTop="true"
android:paddingRight="10dp" />
<TextView

@ -195,6 +195,8 @@
<string name="help_question3">How do I get my money?</string>
<string name="help_question4">What is a Seed Phrase?</string>
<string name="help_question5">How do I transfer ETH into my wallet?</string>
<string name="help_question6">What is TokenScript?</string>
<string name="tokenscript_explaination">tokenscript_explaination.html</string>
<string name="twenty_four_hours">24 hours</string>
<string name="appreciation">Appreciation</string>
<string name="eth_per_ticket">%1s/Ticket</string>

@ -185,6 +185,8 @@
<string name="help_question3">怎样才能拿到法币?</string>
<string name="help_question4">助记词是做什么的?</string>
<string name="help_question5">怎样把以太币转到AlphaWallet内?</string>
<string name="help_question6">What is TokenScript?</string>
<string name="tokenscript_explaination">tokenscript_explaination.html</string>
<string name="twenty_four_hours">24小时</string>
<string name="appreciation">升值</string>
<string name="eth_per_ticket">%1s/门票</string>

@ -195,6 +195,8 @@
<string name="help_question3">How do I get my money?</string>
<string name="help_question4">What is a Seed Phrase?</string>
<string name="help_question5">How do I transfer ETH into my wallet?</string>
<string name="help_question6">What is TokenScript?</string>
<string name="tokenscript_explaination">tokenscript_explaination.html</string>
<string name="twenty_four_hours">24 hours</string>
<string name="appreciation">Appreciation</string>
<string name="eth_per_ticket">%1s/Ticket</string>

Loading…
Cancel
Save