forked from organicmaps/organicmaps-tmp
[yopme] About dialog.
This commit is contained in:
parent
c56463447e
commit
9aa8988141
2 changed files with 24 additions and 4 deletions
|
@ -2,15 +2,18 @@
|
|||
|
||||
<item
|
||||
android:id="@+id/menu_settings"
|
||||
android:icon="@drawable/ic_menu"
|
||||
android:orderInCategory="100"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/menu_settings"/>
|
||||
<item
|
||||
android:id="@+id/menu_help"
|
||||
android:icon="@drawable/ic_menu"
|
||||
android:orderInCategory="101"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/menu_help"/>
|
||||
<item
|
||||
android:id="@+id/menu_about"
|
||||
android:orderInCategory="102"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/about_title"/>
|
||||
|
||||
</menu>
|
|
@ -10,8 +10,11 @@ import com.mapswithme.yopme.map.MapDataProvider;
|
|||
import android.os.Bundle;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.text.SpannableString;
|
||||
import android.text.util.Linkify;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
@ -134,16 +137,30 @@ public class YopmeFrontActivity extends Activity
|
|||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item)
|
||||
{
|
||||
if (item.getItemId() == R.id.menu_help)
|
||||
final int itemId = item.getItemId();
|
||||
if (itemId == R.id.menu_help)
|
||||
{
|
||||
startActivity(new Intent(getApplicationContext(), ReferenceActivity.class));
|
||||
return true;
|
||||
}
|
||||
else if (item.getItemId() == R.id.menu_settings)
|
||||
else if (itemId == R.id.menu_settings)
|
||||
{
|
||||
startActivity(new Intent(getApplicationContext(), YopmePreference.class));
|
||||
return true;
|
||||
}
|
||||
else if (itemId == R.id.menu_about)
|
||||
{
|
||||
final SpannableString linkifiedAbout = new SpannableString(getString(R.string.about));
|
||||
Linkify.addLinks(linkifiedAbout, Linkify.ALL);
|
||||
|
||||
new AlertDialog.Builder(YopmeFrontActivity.this)
|
||||
.setTitle(R.string.about_title)
|
||||
.setMessage(linkifiedAbout)
|
||||
.create()
|
||||
.show();
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue