Merge branch 'fix-ellipsize' into 'master'
Fix ellipsizing on 2.X, other minor updates See merge request !276
This commit is contained in:
commit
ee696b4737
@ -33,6 +33,7 @@ import android.content.pm.PackageManager;
|
|||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
@ -1112,7 +1113,10 @@ public class AppDetails extends AppCompatActivity {
|
|||||||
viewMorePermissions.setText(getString(R.string.less));
|
viewMorePermissions.setText(getString(R.string.less));
|
||||||
} else {
|
} else {
|
||||||
description.setMaxLines(MAX_LINES);
|
description.setMaxLines(MAX_LINES);
|
||||||
|
if (Build.VERSION.SDK_INT > 10) {
|
||||||
|
// ellipsizing doesn't work properly here on 2.X
|
||||||
description.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
description.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||||
|
}
|
||||||
viewMorePermissions.setText(R.string.more);
|
viewMorePermissions.setText(R.string.more);
|
||||||
}
|
}
|
||||||
viewAllDescription ^= true;
|
viewAllDescription ^= true;
|
||||||
@ -1133,7 +1137,10 @@ public class AppDetails extends AppCompatActivity {
|
|||||||
// If description has more than five lines
|
// If description has more than five lines
|
||||||
if (description.getLineCount() > MAX_LINES) {
|
if (description.getLineCount() > MAX_LINES) {
|
||||||
description.setMaxLines(MAX_LINES);
|
description.setMaxLines(MAX_LINES);
|
||||||
|
if (Build.VERSION.SDK_INT > 10) {
|
||||||
|
// ellipsizing doesn't work properly here on 2.X
|
||||||
description.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
description.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||||
|
}
|
||||||
description.setOnClickListener(expanderDescription);
|
description.setOnClickListener(expanderDescription);
|
||||||
viewAllDescription = true;
|
viewAllDescription = true;
|
||||||
|
|
||||||
|
@ -71,7 +71,6 @@ import java.util.zip.Adler32;
|
|||||||
|
|
||||||
public final class Utils {
|
public final class Utils {
|
||||||
|
|
||||||
@SuppressWarnings("UnusedDeclaration")
|
|
||||||
private static final String TAG = "Utils";
|
private static final String TAG = "Utils";
|
||||||
|
|
||||||
private static final int BUFFER_SIZE = 4096;
|
private static final int BUFFER_SIZE = 4096;
|
||||||
|
@ -17,10 +17,8 @@ public abstract class ClipboardCompat {
|
|||||||
return new OldClipboard();
|
return new OldClipboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@TargetApi(11)
|
@TargetApi(11)
|
||||||
class HoneycombClipboard extends ClipboardCompat {
|
private static class HoneycombClipboard extends ClipboardCompat {
|
||||||
|
|
||||||
private final ClipboardManager manager;
|
private final ClipboardManager manager;
|
||||||
|
|
||||||
@ -41,10 +39,11 @@ class HoneycombClipboard extends ClipboardCompat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OldClipboard extends ClipboardCompat {
|
private static class OldClipboard extends ClipboardCompat {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText() {
|
public String getText() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -181,15 +181,14 @@ public class DownloaderService extends Service {
|
|||||||
* message.
|
* message.
|
||||||
*/
|
*/
|
||||||
private String getNotificationTitle(@Nullable String packageName) {
|
private String getNotificationTitle(@Nullable String packageName) {
|
||||||
String title;
|
|
||||||
if (packageName != null) {
|
if (packageName != null) {
|
||||||
App app = AppProvider.Helper.findByPackageName(
|
final App app = AppProvider.Helper.findByPackageName(
|
||||||
getContentResolver(), packageName, new String[]{AppProvider.DataColumns.NAME});
|
getContentResolver(), packageName, new String[]{AppProvider.DataColumns.NAME});
|
||||||
title = getString(R.string.downloading_apk, app.name);
|
if (app != null) {
|
||||||
} else {
|
return getString(R.string.downloading_apk, app.name);
|
||||||
title = getString(R.string.downloading);
|
|
||||||
}
|
}
|
||||||
return title;
|
}
|
||||||
|
return getString(R.string.downloading);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PendingIntent createAppDetailsIntent(@NonNull Context context, int requestCode, @Nullable String packageName) {
|
public static PendingIntent createAppDetailsIntent(@NonNull Context context, int requestCode, @Nullable String packageName) {
|
||||||
|
@ -227,9 +227,6 @@ public class SwapAppsView extends ListView implements
|
|||||||
|
|
||||||
private class AppListAdapter extends CursorAdapter {
|
private class AppListAdapter extends CursorAdapter {
|
||||||
|
|
||||||
@SuppressWarnings("UnusedDeclaration")
|
|
||||||
private static final String TAG = "AppListAdapter";
|
|
||||||
|
|
||||||
private class ViewHolder {
|
private class ViewHolder {
|
||||||
|
|
||||||
private final LocalBroadcastManager localBroadcastManager;
|
private final LocalBroadcastManager localBroadcastManager;
|
||||||
|
@ -656,9 +656,6 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
public static final int TYPE_COMPLETE = 1;
|
public static final int TYPE_COMPLETE = 1;
|
||||||
public static final int TYPE_ERROR = 2;
|
public static final int TYPE_ERROR = 2;
|
||||||
|
|
||||||
@SuppressWarnings("UnusedDeclaration")
|
|
||||||
private static final String TAG = "UpdateAsyncTask";
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
protected final Set<String> selectedApps;
|
protected final Set<String> selectedApps;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.0.0'
|
classpath 'com.android.tools.build:gradle:2.1.0'
|
||||||
classpath files('libs/gradle-witness.jar')
|
classpath files('libs/gradle-witness.jar')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
</module>
|
</module>
|
||||||
<module name="NoLineWrap"/>
|
<module name="NoLineWrap"/>
|
||||||
|
|
||||||
<!--<module name="OneTopLevelClass" />-->
|
<module name="OneTopLevelClass" />
|
||||||
<module name="OneStatementPerLine" />
|
<module name="OneStatementPerLine" />
|
||||||
|
|
||||||
<module name="EmptyBlock">
|
<module name="EmptyBlock">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user