Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gesture Lock & Recents RamBar #1

Open
wants to merge 4 commits into
base: kk4.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/java/android/app/INotificationManager.aidl
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ interface INotificationManager
void cancelAllNotificationsFromListener(in INotificationListener token);

StatusBarNotification[] getActiveNotificationsFromListener(in INotificationListener token);
}

void setHoverBlacklistStatus(String pkg, boolean status);
boolean isPackageAllowedForHover(String pkg);
}
38 changes: 38 additions & 0 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006 The Android Open Source Project
* This code has been modified. Portions copyright (C) 2014, ParanoidAndroid Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -2792,6 +2793,32 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
*/
public static final String POINTER_SPEED = "pointer_speed";

/**
* Whether to show the battery bar
* @hide
*/
public static final String STATUSBAR_BATTERY_BAR = "statusbar_battery_bar";

/**
* @hide
*/
public static final String STATUSBAR_BATTERY_BAR_COLOR = "statusbar_battery_bar_color";

/**
* @hide
*/
public static final String STATUSBAR_BATTERY_BAR_THICKNESS = "statusbar_battery_bar_thickness";

/**
* @hide
*/
public static final String STATUSBAR_BATTERY_BAR_STYLE = "statusbar_battery_bar_style";

/**
* @hide
*/
public static final String STATUSBAR_BATTERY_BAR_ANIMATE = "statusbar_battery_bar_animate";

/**
* I am the lolrus.
* <p>
Expand Down Expand Up @@ -3927,6 +3954,14 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
*/
public static final String RECENT_PANEL_SHOW_TOPMOST = "recent_panel_show_topmost";

/**
* Hover, default is 0 (off).
* 0 = disabled
* 1 = enabled
* @hide
*/
public static final String HOVER_STATE = "hover_state";

/**
* Settings to backup. This is here so that it's in the same place as the settings
* keys and easy to update.
Expand Down Expand Up @@ -6120,6 +6155,9 @@ public static boolean putFloatForUser(ContentResolver cr, String name, float val
/** @hide */
public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";

/** @hide */
public static final String HOVER_FIRST_TIME = "hover_first_time";

/**
* This is the query URI for finding a print service to install.
*
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions packages/SystemUI/res/layout/hover_cling.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 ParanoidAndroid

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dp"
>
<LinearLayout
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="4dp"
android:padding="1dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@*android:drawable/cling_arrow_up"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@*android:drawable/cling_bg"
android:paddingStart="14dp"
android:paddingEnd="14dp"
android:paddingTop="24dp"
android:paddingBottom="24dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hover_cling_text"
android:textColor="#80000000"
android:textSize="16sp"
/>
</FrameLayout>
</LinearLayout>

<Button
android:id="@+id/ok"
android:layout_width="160sp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="18dp"
android:gravity="center"
android:text="@android:string/ok"
android:background="@*android:drawable/cling_button"
/>

</LinearLayout>


28 changes: 28 additions & 0 deletions packages/SystemUI/res/layout/hover_container.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- Copyright (C) 2014 ParanoidAndroid Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<com.android.systemui.statusbar.notification.HoverLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:focusable="true"
android:descendantFocusability="afterDescendants"
android:fitsSystemWindows="true">
<FrameLayout
android:id="@+id/hover_notification"
android:layout_below="@+id/hover_switcher"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</com.android.systemui.statusbar.notification.HoverLayout>
20 changes: 20 additions & 0 deletions packages/SystemUI/res/layout/navigation_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@
android:layout_width="match_parent"
>

<RelativeLayout
android:layout_height="match_parent"
android:layout_width="match_parent">

<com.android.systemui.statusbar.policy.BatteryBarController
android:layout_width="match_parent"
android:layout_height="1dp"
android:visibility="gone"
systemui:viewLocation="2"
android:layout_alignParentTop="true" />

<com.android.systemui.statusbar.policy.BatteryBarController
android:layout_width="match_parent"
android:layout_height="1dp"
android:visibility="gone"
systemui:viewLocation="3"
android:layout_alignParentBottom="true" />

</RelativeLayout>

<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
Expand Down
6 changes: 6 additions & 0 deletions packages/SystemUI/res/layout/status_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,10 @@
/>
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>

<com.android.systemui.statusbar.policy.BatteryBarController
android:layout_width="match_parent"
android:layout_height="1dp"
android:visibility="gone"
systemui:viewLocation="1" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
14 changes: 12 additions & 2 deletions packages/SystemUI/res/layout/status_bar_expanded_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,26 @@
<ImageView android:id="@+id/clear_all_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="4dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
/>

<ImageView android:id="@+id/hover_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_hover_normal"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>

<FrameLayout android:id="@+id/settings_button_holder"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="12dp"
android:layout_marginStart="4dp"
>
<ImageView android:id="@+id/settings_button"
android:layout_width="50dp"
Expand Down
4 changes: 4 additions & 0 deletions packages/SystemUI/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@
<enum name="horizontal" value="0" />
<enum name="vertical" value="1" />
</attr>

<declare-styleable name="BatteryBarController">
<attr name="viewLocation" format="integer" />
</declare-styleable>
</resources>

23 changes: 23 additions & 0 deletions packages/SystemUI/res/values/slim_arrays.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 SlimRoms Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<array name="hover_blacklisted_packages">
<item>com.google.android.googlequicksearchbox</item>
<item>android</item>
</array>

</resources>
5 changes: 5 additions & 0 deletions packages/SystemUI/res/values/slim_dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@
<!-- Network stats text size -->
<dimen name="network_stats_text_size">9dp</dimen>

<!-- Hover dimens -->
<dimen name="hover_height">64dp</dimen>
<dimen name="hover_cling_width">-1px</dimen>


</resources>
3 changes: 3 additions & 0 deletions packages/SystemUI/res/values/slim_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,7 @@
<!-- Navigation bar IME navigation -->
<string name="accessibility_ime_navigation_left">Cursor left</string>
<string name="accessibility_ime_navigation_right">Cursor right</string>

<!-- First time run hover -->
<string name="hover_cling_text">Hover is now enabled.\n\nWhen a new notification arrives, an overlay will show allowing you to respond to it without leaving current app.</string>
</resources>
6 changes: 4 additions & 2 deletions packages/SystemUI/src/com/android/systemui/ExpandHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private boolean isInside(View v, float x, float y) {

if (v == null) {
if (DEBUG) Log.d(TAG, "isinside null subject");
return false;
return true;
}
if (mEventSource != null) {
int[] location = new int[2];
Expand Down Expand Up @@ -519,7 +519,9 @@ private void startExpanding(View v, int expandType) {
}
if (DEBUG) Log.d(TAG, "got mOldHeight: " + mOldHeight +
" mNaturalHeight: " + mNaturalHeight);
v.getParent().requestDisallowInterceptTouchEvent(true);
if (v != null && v.getParent() != null) {
v.getParent().requestDisallowInterceptTouchEvent(true);
}
}

private void finishExpanding(boolean force) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import java.io.File;
import java.io.FilenameFilter;
Expand All @@ -42,8 +41,6 @@ public class QuickRecordingsDialog extends Activity {
private static final String RECORDING_NAME = "QuickRecord ";
private static final String RECORDING_TYPE = ".3gp";

private int mItems;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -63,37 +60,23 @@ public void onResume() {
}
}

mItems = recordings.length;

ListView list = new ListView(this);
list.setAdapter(new ArrayAdapter<String> (this,
android.R.layout.select_dialog_item, dialogEntries));
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View view, int item, long id) {
if (recordings[item] != null) {
Intent intent = new Intent(PLAY_RECORDING);
intent.putExtra("file", recordings[item].getAbsolutePath());
QuickRecordingsDialog.this.sendBroadcast(intent);
}
Intent intent = new Intent(PLAY_RECORDING);
intent.putExtra("file", recordings[item].getAbsolutePath());
QuickRecordingsDialog.this.sendBroadcast(intent);
}
});
list.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
public boolean onItemLongClick(AdapterView<?> arg0, View view, int item, long id) {
if (recordings[item] != null) {
recordings[item].delete();
TextView textView = (TextView) view;
textView.setText(R.string.quick_settings_quick_record_deleted);
Intent intent = new Intent(PLAY_RECORDING);
QuickRecordingsDialog.this.sendBroadcast(intent);
recordings[item] = null;
mItems--;
if (mItems <= 0) {
QuickRecordingsDialog.this.finish();
}
return true;
} else {
return false;
}
recordings[item].delete();
Intent intent = new Intent(PLAY_RECORDING);
QuickRecordingsDialog.this.sendBroadcast(intent);
QuickRecordingsDialog.this.finish();
return true;
}
});
AlertDialog.Builder action = new AlertDialog.Builder(this);
Expand Down
Loading