Commit 569c527d authored by ankit2.kumar's avatar ankit2.kumar Committed by Commit bot

Follow up CL for 541713002

As suggested by 'aurmias' fixed mentioned comments in issue 541713002
Fixed issues:
1.Using one button for stop and reload option.
2.Removed tabs from chrome_shell_acivity.xml
3.moved resource from chrome/android/java/res to chrome/android/shell/res

BUG=

Review URL: https://codereview.chromium.org/546383002

Cr-Commit-Position: refs/heads/master@{#294164}
parent d97aafa2
......@@ -52,8 +52,8 @@ public class ChromeShellToolbar extends LinearLayout {
private SuggestionPopup mSuggestionPopup;
private ImageButton mStopButton;
private ImageButton mReloadButton;
private ImageButton mStopReloadButton;
private boolean mLoading = true;
/**
* @param context The Context the view is running in.
......@@ -90,10 +90,13 @@ public class ChromeShellToolbar extends LinearLayout {
private void onLoadProgressChanged(int progress) {
removeCallbacks(mClearProgressRunnable);
mProgressDrawable.setLevel(100 * progress);
boolean isLoading = progress != 100;
mStopButton.setVisibility(isLoading ? VISIBLE : GONE);
mReloadButton.setVisibility(isLoading ? GONE : VISIBLE);
if (!isLoading) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
mLoading = progress != 100;
if (mLoading) {
mStopReloadButton.setImageResource(R.drawable.btn_stop_normal);
} else {
mStopReloadButton.setImageResource(R.drawable.btn_reload_normal);
postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
}
}
/**
......@@ -182,18 +185,15 @@ public class ChromeShellToolbar extends LinearLayout {
}
private void initializeStopReloadButton() {
mStopButton = (ImageButton)findViewById(R.id.stop);
mStopButton.setOnClickListener(new OnClickListener() {
mStopReloadButton = (ImageButton)findViewById(R.id.stop_reload_button);
mStopReloadButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mTab.getContentViewCore().stopLoading();
}
});
mReloadButton = (ImageButton)findViewById(R.id.reload);
mReloadButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mTab.getContentViewCore().reload(true);
if (mLoading) {
mTab.getContentViewCore().stopLoading();
} else {
mTab.getContentViewCore().reload(true);
}
}
});
}
......
......@@ -16,17 +16,11 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/progress">
<ImageButton android:id="@+id/stop"
<ImageButton android:id="@+id/stop_reload_button"
android:layout_width="38dp"
android:layout_height="38dp"
android:src="@android:drawable/ic_menu_close_clear_cancel"
android:src="@drawable/btn_stop_normal"
android:scaleType="center" />
<ImageButton android:id="@+id/reload"
android:layout_width="38dp"
android:layout_height="38dp"
android:src="@drawable/btn_reload_normal"
android:scaleType="center"
android:visibility="gone" />
<EditText android:id="@+id/url"
android:layout_width="0dp"
android:layout_height="wrap_content"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment