click toolbar to load stream

This commit is contained in:
scoute-dich 2016-03-04 16:29:10 +01:00
parent f196a60919
commit 05bc47c32c
3 changed files with 15 additions and 3 deletions

View File

@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -9,8 +9,8 @@ android {
applicationId "de.baumann.diaspora"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0.1"
}
buildTypes {
release {

View File

@ -109,6 +109,18 @@ public class MainActivity extends AppCompatActivity
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (Helpers.isOnline(MainActivity.this)) {
webView.loadUrl("https://" + podDomain + "/stream");
setTitle(R.string.jb_stream);
} else {
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_LONG).show();
}
}
});
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);