Fresh new done/cancel button styling

This commit is contained in:
Jamie McDonald 2014-03-12 16:36:47 +01:00
parent 3e6f97e31a
commit 349fd35bfb
14 changed files with 97 additions and 50 deletions

View File

@ -84,9 +84,9 @@ public class CropImageActivity extends MonitoredActivity {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.cropimage);
setContentView(R.layout.activity_crop);
mImageView = (CropImageView) findViewById(R.id.cropimage_image);
mImageView = (CropImageView) findViewById(R.id.crop_image);
mImageView.mContext = this;
mImageView.setRecycler(new ImageViewTouchBase.Recycler() {
@Override
@ -131,10 +131,7 @@ public class CropImageActivity extends MonitoredActivity {
return;
}
// Make UI fullscreen.
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
findViewById(R.id.cropimage_discard).setOnClickListener(
findViewById(R.id.btn_cancel).setOnClickListener(
new View.OnClickListener() {
public void onClick(View v) {
setResult(RESULT_CANCELED);
@ -142,7 +139,7 @@ public class CropImageActivity extends MonitoredActivity {
}
});
findViewById(R.id.cropimage_save).setOnClickListener(new View.OnClickListener() {
findViewById(R.id.btn_done).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
onSaveClicked();
}
@ -167,7 +164,7 @@ public class CropImageActivity extends MonitoredActivity {
}
mImageView.setImageRotateBitmapResetBase(mRotateBitmap, true);
Util.startBackgroundJob(this, null,
getResources().getString(R.string.please_wait),
getResources().getString(R.string.wait),
new Runnable() {
public void run() {
final CountDownLatch latch = new CountDownLatch(1);
@ -305,7 +302,7 @@ public class CropImageActivity extends MonitoredActivity {
if (croppedImage != null){
final Bitmap b = croppedImage;
Util.startBackgroundJob(this, null,
getResources().getString(R.string.savingImage),
getResources().getString(R.string.saving),
new Runnable() {
public void run() {
saveOutput(b);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/done_cancel_bar"
layout="@layout/layout_done_cancel" />
<com.soundcloud.android.crop.CropImageView
android:id="@+id/crop_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:layout_below="@id/done_cancel_bar" />
</RelativeLayout>

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<com.soundcloud.android.crop.CropImageView
android:id="@+id/cropimage_image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#55000000"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal"
android:paddingLeft="10dip"
android:paddingRight="10dip">
<Button
android:id="@+id/cropimage_save"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="@string/crop_save_text"/>
<Button
android:id="@+id/cropimage_discard"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/crop_discard_text"/>
</RelativeLayout>
</RelativeLayout>
</FrameLayout>

View File

@ -0,0 +1,30 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/bar_height"
android:orientation="horizontal"
android:divider="?android:attr/dividerVertical"
android:showDividers="middle"
android:dividerPadding="12dp"
android:background="@color/button_bar">
<FrameLayout
style="?android:actionButtonStyle"
android:id="@+id/btn_cancel"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView style="@style/ActionButtonText.Cancel" />
</FrameLayout>
<FrameLayout
style="?android:actionButtonStyle"
android:id="@+id/btn_done"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView style="@style/ActionButtonText.Done" />
</FrameLayout>
</LinearLayout>

View File

@ -0,0 +1,7 @@
<resources>
<color name="button_bar">#f3f3f3</color>
<color name="button_text">#666666</color>
<color name="background">#000000</color>
</resources>

View File

@ -0,0 +1,5 @@
<resources>
<dimen name="bar_height">48dp</dimen>
</resources>

View File

@ -1,8 +1,9 @@
<resources>
<string name="savingImage">Saving picture\u2026</string>
<string name="please_wait">Please wait\u2026</string>
<string name="crop_discard_text">Discard</string>
<string name="crop_save_text">Save</string>
<string name="saving">Saving picture\u2026</string>
<string name="wait">Please wait\u2026</string>
<string name="done">DONE</string>
<string name="cancel">CANCEL</string>
</resources>

View File

@ -0,0 +1,25 @@
<resources>
<style name="ActionButtonText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center_vertical</item>
<item name="android:paddingRight">20dp</item> <!-- Offsets left drawable -->
<item name="android:drawablePadding">8dp</item>
<item name="android:textColor">@color/button_text</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">13sp</item>
</style>
<style name="ActionButtonText.Done">
<item name="android:drawableLeft">@drawable/ic_action_done</item>
<item name="android:text">@string/done</item>
</style>
<style name="ActionButtonText.Cancel">
<item name="android:drawableLeft">@drawable/ic_action_cancel</item>
<item name="android:text">@string/cancel</item>
</style>
</resources>