Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nextcloud/android into re…
Browse files Browse the repository at this point in the history
…sizedImages

# Conflicts:
#	scripts/lint/lint-results.txt
  • Loading branch information
AndyScherzinger committed Aug 11, 2017
2 parents 64c2184 + 519702c commit 69d3df5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion scripts/lint/lint-results.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 1 error and 576 warnings</span>
<span class="mdl-layout-title">Lint Report: 1 error and 581 warnings</span>
Original file line number Diff line number Diff line change
Expand Up @@ -2076,9 +2076,7 @@ public boolean onEditorAction(TextView inputField, int actionId, KeyEvent event)
}

} else if (actionId == EditorInfo.IME_ACTION_NEXT && inputField != null &&
inputField.equals(mHostUrlInput) &&
AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).
equals(mAuthTokenType)) {
inputField.equals(mHostUrlInput)) {
checkOcServer();
}
return false; // always return false to grant that the software keyboard is hidden anyway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if (mAccountSelected) {
setAccount((Account) savedInstanceState.getParcelable(FileActivity.EXTRA_ACCOUNT));
setAccount(savedInstanceState.getParcelable(FileActivity.EXTRA_ACCOUNT));
}

// Listen for sync messages
Expand Down Expand Up @@ -777,12 +777,16 @@ private void populateDirectoryList() {
getStorageManager(), getAccount());

mListView.setAdapter(sa);
}
Button btnChooseFolder = (Button) findViewById(R.id.uploader_choose_folder);
btnChooseFolder.setOnClickListener(this);
btnChooseFolder.getBackground().setColorFilter(ThemeUtils.primaryColor(getAccount()),
PorterDuff.Mode.SRC_ATOP);

getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ThemeUtils.primaryColor(getAccount())));
if (getSupportActionBar() != null) {
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(
ThemeUtils.primaryColor(getAccount())));
}

ThemeUtils.colorStatusBar(this, ThemeUtils.primaryDarkColor(getAccount()));

Expand All @@ -794,7 +798,6 @@ private void populateDirectoryList() {
mListView.setOnItemClickListener(this);
}
}
}

protected void setupEmptyList() {
mEmptyListContainer = (LinearLayout) findViewById(R.id.empty_list_view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ public void run() {


for (RichObject richObject : activity.getRichSubjectElement().getRichObjectList()) {
ImageView imageView = createThumbnail(richObject);
activityViewHolder.list.addView(imageView);
if (richObject.getPath() != null) {
ImageView imageView = createThumbnail(richObject);
activityViewHolder.list.addView(imageView);
}
}

} else {
Expand Down
17 changes: 10 additions & 7 deletions src/main/java/com/owncloud/android/utils/ThemeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,9 @@ public static int fontColor() {
*/
public static boolean darkTheme() {
int primaryColor = primaryColor();
float[] hsl = colorToHSL(primaryColor);

int red = Color.red(primaryColor);
int green = Color.green(primaryColor);
int blue = Color.blue(primaryColor);

return ((0.299 * red + 0.587 * green + 0.114 * blue) / 255) <= 0.5;
return (hsl[2] / 100) <= 0.5;
}

/**
Expand Down Expand Up @@ -173,14 +170,20 @@ public static String getDefaultDisplayNameForRootFolder() {
}

public static int adjustLightness(float lightnessDelta, int color) {
float[] hsl = new float[3];
ColorUtils.RGBToHSL(Color.red(color), Color.green(color), Color.blue(color), hsl);
float[] hsl = colorToHSL(color);

hsl[2] += lightnessDelta;

return ColorUtils.HSLToColor(hsl);
}

private static float[] colorToHSL(int color) {
float[] hsl = new float[3];
ColorUtils.RGBToHSL(Color.red(color), Color.green(color), Color.blue(color), hsl);

return hsl;
}

/**
* sets the tinting of the given ImageButton's icon to color_accent.
*
Expand Down

0 comments on commit 69d3df5

Please sign in to comment.