Skip to content

Commit

Permalink
Modify hotSeat size and background, first page can not add any view, …
Browse files Browse the repository at this point in the history
…fix bug which can not bind appWidget to workSpace.
  • Loading branch information
PureAway committed Mar 23, 2018
1 parent 50b9741 commit c9fc80d
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 46 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
compileSdkVersion 26
buildToolsVersion '26.0.0'

defaultConfig {
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -59,15 +59,15 @@ repositories {
}

dependencies {
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:palette-v7:25.2.0'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:palette-v7:26.0.0-alpha1'
compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'

testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestCompile 'com.android.support:support-annotations:25.2.0'
androidTestCompile 'com.android.support:support-annotations:26.0.0-alpha1'
}

protobuf {
Expand Down
2 changes: 1 addition & 1 deletion res/layout/qsb_container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="match_parent"
android:id="@+id/qsb_container"
android:padding="0dp" >

Expand Down
8 changes: 4 additions & 4 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<resources>
<!-- Dynamic Grid -->
<dimen name="dynamic_grid_edge_margin">8dp</dimen>
<dimen name="dynamic_grid_page_indicator_height">5dp</dimen>
<dimen name="dynamic_grid_page_indicator_width">100dp</dimen>
<dimen name="dynamic_grid_page_indicator_height">20dp</dimen>
<dimen name="dynamic_grid_page_indicator_width">150dp</dimen>
<dimen name="dynamic_grid_page_indicator_line_height">5dp</dimen>
<dimen name="dynamic_grid_page_indicator_gutter_width_left_nav_bar">38dp</dimen>
<dimen name="dynamic_grid_page_indicator_gutter_width_right_nav_bar">48dp</dimen>
Expand All @@ -26,7 +26,7 @@
<dimen name="dynamic_grid_overview_max_icon_zone_height">120dp</dimen>
<dimen name="dynamic_grid_overview_bar_item_width">80dp</dimen>
<dimen name="dynamic_grid_overview_bar_spacer_width">25dp</dimen>
<dimen name="dynamic_grid_hotseat_height">58dp</dimen>
<dimen name="dynamic_grid_hotseat_height">96dp</dimen>
<dimen name="dynamic_grid_hotseat_top_padding">4dp</dimen>
<dimen name="dynamic_grid_hotseat_gutter_width">24dp</dimen>
<dimen name="dynamic_grid_workspace_top_padding">12dp</dimen>
Expand Down Expand Up @@ -135,7 +135,7 @@
<!-- Folders -->
<!-- The size of the padding on the preview background drawable -->
<dimen name="folder_preview_padding">6dp</dimen>
<dimen name="page_indicator_dot_size">4dp</dimen>
<dimen name="page_indicator_dot_size">8dp</dimen>

<dimen name="folder_cell_x_padding">9dp</dimen>
<dimen name="folder_cell_y_padding">6dp</dimen>
Expand Down
22 changes: 11 additions & 11 deletions res/xml/default_workspace_3x3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
<!-- Messaging, [All Apps], Dialer -->

<!-- <resolve
launcher:container="-101"
launcher:screen="0"
launcher:x="0"
launcher:y="0" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MESSAGING;end" />
<favorite launcher:uri="sms:" />
<favorite launcher:uri="smsto:" />
<favorite launcher:uri="mms:" />
<favorite launcher:uri="mmsto:" />
</resolve>-->
<resolve
launcher:container="-101"
launcher:screen="0"
launcher:x="0"
launcher:y="0">
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MESSAGING;end" />
<favorite launcher:uri="sms:" />
<favorite launcher:uri="smsto:" />
<favorite launcher:uri="mms:" />
<favorite launcher:uri="mmsto:" />
</resolve>

<!-- All Apps -->

Expand Down
10 changes: 5 additions & 5 deletions res/xml/default_workspace_5x6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<include launcher:workspace="@xml/dw_tablet_hotseat" />

<!-- Bottom row -->
<!-- <favorite
launcher:screen="0"
launcher:x="0"
launcher:y="-1"
launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_CONTACTS;end" />-->
<favorite
launcher:screen="0"
launcher:x="0"
launcher:y="-1"
launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_CONTACTS;end" />
<!--
<resolve
launcher:screen="0"
Expand Down
4 changes: 2 additions & 2 deletions src/com/android/launcher3/DeleteDropTarget.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
* @return true for items that should have a "Remove" action in accessibility.
*/
public static boolean supportsAccessibleDrop(ItemInfo info) {
return info.itemType == 1;
return info.itemType == 1 || info.itemType == 4;
}

@Override
protected boolean supportsDrop(DragSource source, ItemInfo info) {
return info.itemType == 1;
return info.itemType == 1 || info.itemType == 4;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/com/android/launcher3/Hotseat.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Hotseat(Context context, AttributeSet attrs, int defStyle) {
mLauncher = Launcher.getLauncher(context);
mHasVerticalHotseat = mLauncher.getDeviceProfile().isVerticalBarLayout();
mBackgroundColor = ColorUtils.setAlphaComponent(
ContextCompat.getColor(context, R.color.hot_seat_bg_color), 0);
ContextCompat.getColor(context, R.color.hot_seat_bg_color), 50);
mBackground = new ColorDrawable(mBackgroundColor);
setBackground(mBackground);
}
Expand Down Expand Up @@ -112,7 +112,7 @@ int getCellYFromOrder(int rank) {
protected void onFinishInflate() {
super.onFinishInflate();
DeviceProfile grid = mLauncher.getDeviceProfile();
mContent = (CellLayout) findViewById(R.id.layout);
mContent = findViewById(R.id.layout);
//modify
// if (grid.isLandscape && !grid.isLargeTablet) {
// mContent.setGridSize(1, (int) grid.inv.numHotseatIcons);
Expand Down
2 changes: 1 addition & 1 deletion src/com/android/launcher3/InvariantDeviceProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public InvariantDeviceProfile(InvariantDeviceProfile p) {
iconSize = interpolatedDeviceProfileOut.iconSize;
iconBitmapSize = Utilities.pxFromDp(iconSize, dm);
iconTextSize = interpolatedDeviceProfileOut.iconTextSize;
hotseatIconSize = interpolatedDeviceProfileOut.hotseatIconSize;
hotseatIconSize = iconSize; // modify
fillResIconDpi = getLauncherIconDensity(iconBitmapSize);

// If the partner customization apk contains any grid overrides, apply them
Expand Down
5 changes: 3 additions & 2 deletions src/com/android/launcher3/Workspace.java
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,9 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// View qsbContainer = mLauncher.getQsbContainer();
// ViewGroup.LayoutParams lp = qsbContainer.getLayoutParams();
//
// lp.width = LayoutParams.MATCH_PARENT;
// lp.height = LayoutParams.MATCH_PARENT;
//
// lp.width = firstPage.getWidth();
// lp.height = firstPage.getHeight();
// qsbContainer.setLayoutParams(lp);

// if (cellHeight > 0 && lp.height != cellHeight) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public boolean bindAppWidgetIdIfAllowed(int appWidgetId, AppWidgetProviderInfo i

@Override
public boolean bindAppWidgetIdSkipBindPermission(int appWidgetId, AppWidgetProviderInfo info, Bundle options) {
return true;
return mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId, info.provider, options);
}

@Override
Expand Down Expand Up @@ -120,11 +120,10 @@ public HashMap<ComponentKey, AppWidgetProviderInfo> getAllProvidersMap() {
}
return result;
}

@Override
public void setBindAppWidgetPermission() {

// mAppWidgetManager.setBindAppWidgetPermission("com.android.launcher3",
// true);
// true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public boolean bindAppWidgetIdIfAllowed(int appWidgetId, AppWidgetProviderInfo i

@Override
public boolean bindAppWidgetIdSkipBindPermission(int appWidgetId, AppWidgetProviderInfo info, Bundle options) {
return true;
return mAppWidgetManager.bindAppWidgetIdIfAllowed(
appWidgetId, info.getProfile(), info.provider, options);
// return mAppWidgetManager.bindAppWidgetIdSkipBindPermission(appWidgetId,info.provider,options,true);
}

@Override
Expand Down Expand Up @@ -177,11 +179,10 @@ public HashMap<ComponentKey, AppWidgetProviderInfo> getAllProvidersMap() {
}
return result;
}

@Override
public void setBindAppWidgetPermission() {

// mAppWidgetManager.setBindAppWidgetPermission("com.android.launcher3",
// true);
// true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public PageIndicatorDots(Context context, AttributeSet attrs, int defStyleAttr)

mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mCirclePaint.setStyle(Style.FILL);
mCirclePaint.setAntiAlias(true);
mDotRadius = getResources().getDimension(R.dimen.page_indicator_dot_size) / 2;
setOutlineProvider(new MyOutlineProver());

Expand Down Expand Up @@ -306,10 +307,10 @@ private RectF getActiveRect() {
sTempRect.right = getWidth() - sTempRect.left;
sTempRect.left = sTempRect.right - rectWidth;
}
sTempRect.top = sTempRect.top - 2;
sTempRect.bottom = sTempRect.bottom + 2;
sTempRect.left = sTempRect.left - 2;
sTempRect.right = sTempRect.right + 2;
sTempRect.top = sTempRect.top - 1;
sTempRect.bottom = sTempRect.bottom + 1;
sTempRect.left = sTempRect.left - 1;
sTempRect.right = sTempRect.right + 1;
return sTempRect;
}

Expand Down
2 changes: 1 addition & 1 deletion src_config/com/android/launcher3/config/FeatureFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private FeatureFlags() {}
public static boolean LAUNCHER3_ALL_APPS_PULL_UP = false;

// Feature flag to enable moving the QSB on the 0th screen of the workspace.
public static final boolean QSB_ON_FIRST_SCREEN = false;
public static final boolean QSB_ON_FIRST_SCREEN = true;
// When enabled the all-apps icon is not added to the hotseat.
public static final boolean NO_ALL_APPS_ICON = true;
// When enabled fling down gesture on the first workspace triggers search.
Expand Down

0 comments on commit c9fc80d

Please sign in to comment.