Created
May 5, 2015 23:57
-
-
Save thisandagain/33c918dd9f7896d5a9d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mozilla.org.webmaker.activity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.widget.RelativeLayout; | |
import mozilla.org.webmaker.R; | |
import mozilla.org.webmaker.WebmakerActivity; | |
import mozilla.org.webmaker.view.WebmakerWebView; | |
public class Map extends WebmakerActivity { | |
public Map() { | |
super("map", R.id.map_layout, R.layout.map_layout, R.menu.menu_map); | |
} | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// Extract route information from intent extras | |
Bundle intentExtras = getIntent().getExtras(); | |
String projectId = intentExtras.get("id").toString(); | |
Log.v("Route!", projectId); | |
} | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getMenuInflater().inflate(menuResId, menu); | |
return true; | |
} | |
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
return item.getItemId() == R.id.action_settings; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mozilla.org.webmaker; | |
import android.app.Application; | |
import android.util.Log; | |
import mozilla.org.webmaker.activity.Editor; | |
import mozilla.org.webmaker.activity.Map; | |
import mozilla.org.webmaker.activity.Project; | |
import mozilla.org.webmaker.activity.Tinker; | |
import mozilla.org.webmaker.router.Router; | |
public class WebmakerApplication extends Application { | |
// Singleton | |
private WebmakerApplication singleton; | |
public WebmakerApplication getInstance(){ | |
return singleton; | |
} | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
singleton = this; | |
Log.v("[Webmaker]", "Application created."); | |
// Router | |
Router.sharedRouter().setContext(getApplicationContext()); | |
Router.sharedRouter().map("/main", MainActivity.class); | |
Router.sharedRouter().map("/main/:tab", MainActivity.class); | |
Router.sharedRouter().map("/map/:id", Map.class); | |
Router.sharedRouter().map("/projects/:projectId", Project.class); | |
Router.sharedRouter().map("/projects/:projectId/elements/:elementId", Editor.class); | |
Router.sharedRouter().map("/projects/:projectId/elements/:elementId/:attributeId", Tinker.class); | |
} | |
@Override | |
public void onLowMemory() { | |
super.onLowMemory(); | |
} | |
@Override | |
public void onTerminate() { | |
super.onTerminate(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment