1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2025-09-09 18:29:47 +02:00

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

@ -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);