Skip to content

Commit

Permalink
some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Sep 29, 2012
1 parent 8cf6b1a commit bdf1aeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/org/mariotaku/twidere/fragment/UserProfileFragment.java
Expand Up @@ -435,7 +435,8 @@ public void onLoadFinished(Loader<Bitmap> loader, Bitmap data) {
if (data == null) return;
final Drawable d = new BitmapDrawable(getResources(), data);
final LayoutParams lp = mProfileNameBannerContainer.getLayoutParams();
lp.height = mProfileNameContainer.getWidth() / 2;
final float ratio = (float) data.getHeight() / (float) data.getWidth();
lp.height = (int) (mProfileNameContainer.getWidth() * ratio);
mProfileNameBannerContainer.setLayoutParams(lp);
mProfileNameBannerContainer.setBackgroundDrawable(d);
}
Expand Down
Expand Up @@ -21,7 +21,6 @@ public class ImageUploaderPickerPreference extends DialogPreference implements C

private SharedPreferences mPreferences;
private final PackageManager mPackageManager;
private AlertDialog mDialog;
private ImageUploaderSpec[] mAvailableImageUploaders;

public ImageUploaderPickerPreference(final Context context) {
Expand All @@ -46,9 +45,7 @@ public void onClick(final DialogInterface dialog, final int which) {
editor.putString(PREFERENCE_KEY_IMAGE_UPLOADER, spec.cls);
editor.commit();
}
if (mDialog != null && mDialog.isShowing()) {
mDialog.dismiss();
}
dialog.dismiss();
}

@Override
Expand Down

0 comments on commit bdf1aeb

Please sign in to comment.