use of com.klinker.android.twitter.adapters.ChangelogAdapter in project Talon-for-Twitter by klinker24.
the class SettingsLinkDrawerClickListener method onItemClick.
@Override
public void onItemClick(AdapterView parent, View view, int position, long id) {
Intent intent;
final int mPos = position;
if (mPos < 2) {
// one of the settings pages
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mDrawerLayout.closeDrawer(Gravity.START);
}
}, 300);
viewPager.setCurrentItem(mPos + 7, true);
} else if (mPos == 2) {
// changelog
final ListView list = new ListView(context);
list.setDividerHeight(0);
new AsyncTask<Spanned[], Void, Spanned[]>() {
@Override
public Spanned[] doInBackground(Spanned[]... params) {
return XmlChangelogUtils.parse(context);
}
@Override
public void onPostExecute(Spanned[] result) {
list.setAdapter(new ChangelogAdapter(context, result));
}
}.execute();
new AlertDialog.Builder(context).setTitle(R.string.changelog).setView(list).setPositiveButton(R.string.ok, null).show();
} else if (mPos == 3) {
// rate it option
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Uri uri = Uri.parse("market://details?id=" + context.getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
context.startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
Toast.makeText(context, "Couldn't launch the market", Toast.LENGTH_SHORT).show();
}
}
}, 200);
}
}
use of com.klinker.android.twitter.adapters.ChangelogAdapter in project Talon-for-Twitter by klinker24.
the class SettingsActivity method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case R.id.menu_whats_new:
final Context context = this;
final ListView list = new ListView(this);
list.setDividerHeight(0);
new AsyncTask<Spanned[], Void, Spanned[]>() {
@Override
public Spanned[] doInBackground(Spanned[]... params) {
return XmlChangelogUtils.parse(context);
}
@Override
public void onPostExecute(Spanned[] result) {
list.setAdapter(new ChangelogAdapter(context, result));
}
}.execute();
new AlertDialog.Builder(this).setTitle(R.string.changelog).setView(list).setPositiveButton(R.string.ok, null).show();
return true;
case R.id.menu_rate_it:
Uri uri = Uri.parse("market://details?id=" + getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "Couldn't launch the market", Toast.LENGTH_SHORT).show();
}
return true;
case R.id.menu_get_help:
showSettings(8, getString(R.string.get_help_settings));
return true;
case R.id.menu_other_apps:
showSettings(9, getString(R.string.other_apps));
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Aggregations