This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
trebuchet_port.patch
164 lines (157 loc) · 7.22 KB
/
trebuchet_port.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 78e4db7..56bcee0 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -22,7 +22,7 @@
package="com.cyanogenmod.trebuchet"
android:versionName="@string/application_version">
- <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="17" />
+ <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16" />
<permission
android:name="com.android.launcher.permission.PRELOAD_WORKSPACE"
@@ -67,8 +67,7 @@
android:label="@string/application_name"
android:icon="@mipmap/ic_launcher_home"
android:hardwareAccelerated="true"
- android:largeHeap="@bool/config_largeHeap"
- android:supportsRtl="true">
+ android:largeHeap="@bool/config_largeHeap">
<activity
android:name="com.cyanogenmod.trebuchet.Launcher"
android:launchMode="singleTask"
diff --git a/res/layout/apps_customize_pane.xml b/res/layout/apps_customize_pane.xml
index bee51d7..0eef96d 100644
--- a/res/layout/apps_customize_pane.xml
+++ b/res/layout/apps_customize_pane.xml
@@ -22,8 +22,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:visibility="gone"
- android:layoutDirection="ltr">
+ android:visibility="gone">
<!-- The layout_width of the tab bar gets overriden to align the content
with the text in the tabs in AppsCustomizeTabHost. -->
<FrameLayout
diff --git a/res/layout/preference_header_item.xml b/res/layout/preference_header_item.xml
index 75536af..ec86834 100644
--- a/res/layout/preference_header_item.xml
+++ b/res/layout/preference_header_item.xml
@@ -20,13 +20,10 @@
android:layout_height="wrap_content"
android:minHeight="48dp"
android:background="?android:attr/activatedBackgroundIndicator"
- android:gravity="center_vertical"
- android:paddingEnd="?android:attr/scrollbarSize">
+ android:gravity="center_vertical">
<LinearLayout
android:layout_width="wrap_content"
- android:layout_marginStart="6dip"
- android:layout_marginEnd="6dip"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/icon"
@@ -38,8 +35,6 @@
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="2dip"
- android:layout_marginEnd="6dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">
@@ -56,7 +51,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
- android:layout_alignStart="@android:id/title"
android:textAppearance="?android:attr/textAppearanceSmall"
android:ellipsize="end"
android:maxLines="2" />
diff --git a/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
index 9f7595d..63c138c 100644
--- a/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
+++ b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
@@ -736,25 +736,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
Bundle getDefaultOptionsForWidget(PendingAddWidgetInfo info) {
Bundle options = null;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
- AppWidgetResizeFrame.getWidgetSizeRanges(mLauncher, info.spanX, info.spanY, mTmpRect);
- Rect padding = AppWidgetHostView.getDefaultPaddingForWidget(mLauncher,
- info.componentName, null);
-
- float density = getResources().getDisplayMetrics().density;
- int xPaddingDips = (int) ((padding.left + padding.right) / density);
- int yPaddingDips = (int) ((padding.top + padding.bottom) / density);
-
- options = new Bundle();
- options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH,
- mTmpRect.left - xPaddingDips);
- options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT,
- mTmpRect.top - yPaddingDips);
- options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH,
- mTmpRect.right - xPaddingDips);
- options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT,
- mTmpRect.bottom - yPaddingDips);
- }
+
return options;
}
@@ -774,17 +756,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mWidgetLoadingId = mLauncher.getAppWidgetHost().allocateAppWidgetId();
// Options will be null for platforms with JB or lower, so this serves as an
// SDK level check.
- if (options == null) {
- if (AppWidgetManager.getInstance(mLauncher).bindAppWidgetIdIfAllowed(
- mWidgetLoadingId, info.componentName)) {
- mWidgetCleanupState = WIDGET_BOUND;
- }
- } else {
- if (AppWidgetManager.getInstance(mLauncher).bindAppWidgetIdIfAllowed(
- mWidgetLoadingId, info.componentName, options)) {
- mWidgetCleanupState = WIDGET_BOUND;
- }
- }
+
}
};
post(mBindWidgetRunnable);
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java
index 320b869..4ee0a2b 100644
--- a/src/com/cyanogenmod/trebuchet/Launcher.java
+++ b/src/com/cyanogenmod/trebuchet/Launcher.java
@@ -1840,14 +1840,8 @@ public final class Launcher extends Activity
appWidgetId = getAppWidgetHost().allocateAppWidgetId();
Bundle options = info.bindOptions;
- boolean success;
- if (options != null) {
- success = mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
- info.componentName, options);
- } else {
- success = mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
- info.componentName);
- }
+ boolean success=false;
+
if (success) {
addAppWidgetImpl(appWidgetId, info, null, info.info);
} else {
diff --git a/src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java b/src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java
index 9bd11a1..e666e8e 100644
--- a/src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/UserInitializeReceiver.java
@@ -47,14 +47,7 @@ public class UserInitializeReceiver extends BroadcastReceiver {
Context.WALLPAPER_SERVICE);
for (int i=1; i<list.size(); i++) {
int resid = list.get(i);
- if (!wpm.hasResourceWallpaper(resid)) {
- try {
- wpm.setResource(resid);
- } catch (IOException e) {
- // Ignore
- }
- return;
- }
+
}
}