Commit 76fbdce6 authored by Frantisek Simon's avatar Frantisek Simon

mlatner/tablexia-libgdx#261 Show notification about new version of

Tablexia
parent db06843d
......@@ -15,6 +15,8 @@
<string name="dialog_question">Naozaj?</string>
<string name="dialog_question_no">Nie</string>
<string name="dialog_question_yes">Áno</string>
<string name="dialog_understand">Rozumiem</string>
<string name="dialog_sk_disabled"><![CDATA[Pozor, táto verzia už nieje podporovaná. Novú verziu dostupnú v českom a slovenskom jazyku a obsahujúcu mnoho vylepšení je možné stiahnuť tu <a href="http://play.google.com/store/apps/details?id=cz.nic.tablexia">Google Play</a><br /><br />]]></string>
<string name="difficulty_easy">Ľahká</string>
<string name="difficulty_hard">Ťažká</string>
<string name="difficulty_normal">Stredná</string>
......
......@@ -85,6 +85,8 @@
<string name="dialog_question_yes">Ano</string>
<string name="dialog_question_no">Ne</string>
<string name="dialog_question">Opravdu?</string>
<string name="dialog_understand">Rozumím</string>
<string name="dialog_sk_disabled"><![CDATA[Pozor, tato verze už není podporovaná. Novou verzi dostupnou v českém a slovenském jazyce a obsahující mnoho vylepšení je možné stáhnout zde <a href="http://play.google.com/store/apps/details?id=cz.nic.tablexia">Google Play</a> <br /><br />]]></string>
<!-- SUBSCRIPTION DIALOG -->
<string name="subscriptiondialog_sign">Podepsat</string>
......
......@@ -27,6 +27,7 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Point;
import android.net.Uri;
import android.os.Bundle;
import android.os.Messenger;
import android.support.v4.app.Fragment;
......@@ -34,8 +35,15 @@ import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.widget.DrawerLayout.DrawerListener;
import android.text.Html;
import android.text.util.Linkify;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.widget.TextView;
import com.activeandroid.util.Log;
import com.google.android.vending.expansion.downloader.DownloadProgressInfo;
......@@ -58,6 +66,7 @@ import cz.nic.tablexia.menu.usermenu.User;
import cz.nic.tablexia.newusers.fragment.AnimationContainerFragment;
import cz.nic.tablexia.util.MediaPlayerHelper;
import cz.nic.tablexia.util.MintHelper;
import cz.nic.tablexia.widget.TablexiaButtonViewDialog;
import cz.nic.tablexia.widget.TablexiaDrawerLayout;
/**
......@@ -93,6 +102,54 @@ public class MainActivity extends FragmentActivity implements MenuActivity, IDow
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new TablexiaButtonViewDialog() {
@Override
protected int getTextResource() {
return R.string.dialog_sk_disabled;
}
@Override
protected int getPositiveButtonText() {
return R.string.dialog_understand;
}
@Override
protected void addTextView(LayoutInflater inflater, ViewGroup contentView) {
TextView textView = (TextView) inflater.inflate(R.layout.tablexiadialog_text, contentView, false);
if (textView != null) {
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, getTextSize());
textView.setLinksClickable(true);
textView.setAutoLinkMask(Linkify.ALL);
textView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=cz.nic.tablexia")));
}
});
int textResource = getTextResource();
String textString = getTextString();
CharSequence textCharSequence = getTextCharSequence();
if (textResource > 0) {
textView.setText(Html.fromHtml(getString(textResource)));
} else if (textString != null) {
textView.setText(Html.fromHtml(textString));
} else if (textCharSequence != null) {
textView.setText(textCharSequence);
}
}
contentView.addView(textView);
}
@Override
protected int getQuestionButtonLayoutId() {
return R.layout.tablexiadialog_questionbutton_single;
};
}.show(getFragmentManager(), null);
MintHelper.startBugSense(this);
getTablexiaContext().setCurreActivity(this);
if (savedInstanceState != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment