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 { ...@@ -52,8 +52,8 @@ public class ChromeShellToolbar extends LinearLayout {
private SuggestionPopup mSuggestionPopup; private SuggestionPopup mSuggestionPopup;
private ImageButton mStopButton; private ImageButton mStopReloadButton;
private ImageButton mReloadButton; private boolean mLoading = true;
/** /**
* @param context The Context the view is running in. * @param context The Context the view is running in.
...@@ -90,10 +90,13 @@ public class ChromeShellToolbar extends LinearLayout { ...@@ -90,10 +90,13 @@ public class ChromeShellToolbar extends LinearLayout {
private void onLoadProgressChanged(int progress) { private void onLoadProgressChanged(int progress) {
removeCallbacks(mClearProgressRunnable); removeCallbacks(mClearProgressRunnable);
mProgressDrawable.setLevel(100 * progress); mProgressDrawable.setLevel(100 * progress);
boolean isLoading = progress != 100; mLoading = progress != 100;
mStopButton.setVisibility(isLoading ? VISIBLE : GONE); if (mLoading) {
mReloadButton.setVisibility(isLoading ? GONE : VISIBLE); mStopReloadButton.setImageResource(R.drawable.btn_stop_normal);
if (!isLoading) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS); } else {
mStopReloadButton.setImageResource(R.drawable.btn_reload_normal);
postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
}
} }
/** /**
...@@ -182,19 +185,16 @@ public class ChromeShellToolbar extends LinearLayout { ...@@ -182,19 +185,16 @@ public class ChromeShellToolbar extends LinearLayout {
} }
private void initializeStopReloadButton() { private void initializeStopReloadButton() {
mStopButton = (ImageButton)findViewById(R.id.stop); mStopReloadButton = (ImageButton)findViewById(R.id.stop_reload_button);
mStopButton.setOnClickListener(new OnClickListener() { mStopReloadButton.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (mLoading) {
mTab.getContentViewCore().stopLoading(); mTab.getContentViewCore().stopLoading();
} } else {
});
mReloadButton = (ImageButton)findViewById(R.id.reload);
mReloadButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mTab.getContentViewCore().reload(true); mTab.getContentViewCore().reload(true);
} }
}
}); });
} }
......
...@@ -16,17 +16,11 @@ ...@@ -16,17 +16,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:background="@drawable/progress"> android:background="@drawable/progress">
<ImageButton android:id="@+id/stop" <ImageButton android:id="@+id/stop_reload_button"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="38dp" android:layout_height="38dp"
android:src="@android:drawable/ic_menu_close_clear_cancel" android:src="@drawable/btn_stop_normal"
android:scaleType="center" /> 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" <EditText android:id="@+id/url"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" 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