Backed out changeset 094e6802c2f4 (bug 1389269)

This commit is contained in:
Sebastian Hengst 2017-08-15 18:30:08 +02:00
Родитель b1e6b1efff
Коммит 6e4e96760c
1 изменённых файлов: 25 добавлений и 3 удалений

Просмотреть файл

@ -50,6 +50,7 @@ public class WebAppActivity extends AppCompatActivity
public static final String MANIFEST_PATH = "MANIFEST_PATH";
private static final String SAVED_INTENT = "savedIntent";
private TextView mUrlView;
private GeckoView mGeckoView;
private PromptService mPromptService;
@ -72,8 +73,24 @@ public class WebAppActivity extends AppCompatActivity
super.onCreate(savedInstanceState);
mGeckoView = new GeckoView(this);
setContentView(R.layout.customtabs_activity);
final Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar);
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
actionBar.setCustomView(R.layout.webapps_action_bar_custom_view);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.hide();
final View customView = actionBar.getCustomView();
mUrlView = (TextView) customView.findViewById(R.id.webapps_action_bar_url);
mGeckoView = (GeckoView) findViewById(R.id.gecko_view);
mGeckoView.setNavigationListener(this);
mPromptService = new PromptService(this, mGeckoView.getEventDispatcher());
final GeckoViewSettings settings = mGeckoView.getSettings();
@ -84,8 +101,6 @@ public class WebAppActivity extends AppCompatActivity
mGeckoView.loadUri(u.toString());
}
setContentView(mGeckoView);
loadManifest(getIntent().getStringExtra(MANIFEST_PATH));
}
@ -271,6 +286,13 @@ public class WebAppActivity extends AppCompatActivity
/* GeckoView.NavigationListener */
@Override
public void onLocationChange(GeckoView view, String url) {
if (isInScope(url)) {
getSupportActionBar().hide();
} else {
getSupportActionBar().show();
}
mUrlView.setText(url);
}
@Override