|
1 | | -package com.artikus.nolauncher; |
| 1 | +package me.pompel.elauncher; |
2 | 2 |
|
3 | 3 | import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; |
4 | 4 |
|
|
35 | 35 | import android.widget.LinearLayout; |
36 | 36 | import android.widget.TextView; |
37 | 37 |
|
38 | | -import com.artikus.nolauncher.recyclerAdapter; |
39 | | - |
40 | 38 | import java.util.ArrayList; |
41 | 39 | import java.util.Collections; |
42 | 40 |
|
@@ -87,11 +85,6 @@ private void openAppWithIntent(Intent intent, boolean change) { |
87 | 85 | if (change) changeLayout(true, false); |
88 | 86 | } |
89 | 87 |
|
90 | | - public void lock() { |
91 | | - try { Runtime.getRuntime().exec(new String[] { "su", "-c", "input keyevent 26" }).waitFor(); } |
92 | | - catch (Exception e) { e.printStackTrace(); } |
93 | | - } |
94 | | - |
95 | 88 | @Override public void onBackPressed() { if (findViewById(R.id.AppDrawer).getVisibility() == View.VISIBLE) changeLayout(true, true); } |
96 | 89 |
|
97 | 90 | @Override protected void onCreate(Bundle savedInstanceState) { |
@@ -151,9 +144,9 @@ else if (!recyclerView.canScrollVertically(-1)) { |
151 | 144 | CharSequence[] alertApps = appNames.toArray(new CharSequence[0]); |
152 | 145 | for (int i = 0; i < prefs.getInt("apps", 8); i++) { |
153 | 146 | TextView textView = new TextView(this); |
154 | | - textView.setTextColor(Color.WHITE); |
| 147 | + textView.setTextColor(Color.BLACK); |
155 | 148 | textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 25); |
156 | | - textView.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL)); |
| 149 | + textView.setTypeface(Typeface.create("sans-serif-bold", Typeface.NORMAL)); |
157 | 150 | textView.setPadding(0, 0, 0, 50); |
158 | 151 | textView.setText(prefs.getString(Integer.toString(i), "App")); |
159 | 152 | textView.setTag(i); |
@@ -207,13 +200,17 @@ else if (Math.abs(yDiff) > 100 && Math.abs(velocityY) > 100) { |
207 | 200 | catch (Exception e) { e.printStackTrace(); } |
208 | 201 | else { |
209 | 202 | changeLayout(false, true); |
210 | | - keyboardAction(false); |
| 203 | + keyboardAction(true); |
211 | 204 | } |
212 | 205 | } |
213 | 206 | return true; |
214 | 207 | } |
215 | 208 |
|
216 | | - @Override public boolean onDoubleTap(MotionEvent e) { lock(); return true; } |
| 209 | + @Override public boolean onDoubleTap(MotionEvent e) { |
| 210 | + changeLayout(false, true); |
| 211 | + keyboardAction(false); |
| 212 | + return true; |
| 213 | + } |
217 | 214 |
|
218 | 215 | @Override public void onLongPress(MotionEvent e) { |
219 | 216 | super.onLongPress(e); |
|
0 commit comments