Skip to content

Commit be40fd6

Browse files
committed
gradle build fix
1 parent cd914aa commit be40fd6

File tree

9 files changed

+241
-38
lines changed

9 files changed

+241
-38
lines changed

.idea/misc.xml

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/yzy/supercleanmaster/fragment/MainFragment.java

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.yzy.supercleanmaster.fragment;
22

3+
import android.app.ActivityManager;
34
import android.content.Context;
5+
import android.content.pm.ApplicationInfo;
6+
import android.content.pm.PackageManager;
47
import android.os.Bundle;
58
import android.support.annotation.Nullable;
69
import android.view.LayoutInflater;
@@ -15,13 +18,15 @@
1518
import com.yzy.supercleanmaster.base.BaseFragment;
1619
import com.yzy.supercleanmaster.model.SDCardInfo;
1720
import com.yzy.supercleanmaster.ui.AutoStartManageActivity;
21+
import com.yzy.supercleanmaster.ui.BatterySavingActivity;
1822
import com.yzy.supercleanmaster.ui.MemoryCleanActivity;
1923
import com.yzy.supercleanmaster.ui.RubbishCleanActivity;
2024
import com.yzy.supercleanmaster.ui.SoftwareManageActivity;
2125
import com.yzy.supercleanmaster.utils.AppUtil;
2226
import com.yzy.supercleanmaster.utils.StorageUtil;
2327
import com.yzy.supercleanmaster.widget.circleprogress.ArcProgress;
2428

29+
import java.util.List;
2530
import java.util.Timer;
2631
import java.util.TimerTask;
2732

@@ -159,14 +164,42 @@ void rubbishClean() {
159164
startActivity(RubbishCleanActivity.class);
160165
}
161166

167+
@OnClick(R.id.card3)
168+
void batterySaving() {
169+
List<ApplicationInfo> packages;
170+
PackageManager pm;
171+
pm = getPackageManager();
172+
//get a list of installed apps.
173+
packages = pm.getInstalledApplications(0);
162174

175+
ActivityManager mActivityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
176+
177+
for (ApplicationInfo packageInfo : packages) {
178+
if((packageInfo.flags & ApplicationInfo.FLAG_SYSTEM)==1)continue;
179+
if(packageInfo.packageName.equals("mypackage")) continue;
180+
mActivityManager.killBackgroundProcesses(packageInfo.packageName);
181+
}
182+
//startActivity(BatterySavingActivity.class);
183+
}
163184

164185

165186
@OnClick(R.id.card4)
166187
void SoftwareManage() {
167188
startActivity(SoftwareManageActivity.class);
168189
}
169-
190+
List<ApplicationInfo> packages;
191+
PackageManager pm;
192+
pm = getPackageManager();
193+
//get a list of installed apps.
194+
packages = pm.getInstalledApplications(0);
195+
196+
ActivityManager mActivityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
197+
198+
for (ApplicationInfo packageInfo : packages) {
199+
if((packageInfo.flags & ApplicationInfo.FLAG_SYSTEM)==1)continue;
200+
if(packageInfo.packageName.equals("mypackage")) continue;
201+
mActivityManager.killBackgroundProcesses(packageInfo.packageName);
202+
}
170203
@Override
171204
public void onDestroyView() {
172205
super.onDestroyView();
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.yzy.supercleanmaster.ui;
2+
3+
import android.app.ActivityManager;
4+
import android.content.Context;
5+
import android.content.pm.ApplicationInfo;
6+
import android.content.pm.PackageManager;
7+
import android.widget.Toast;
8+
9+
import java.util.List;
10+
11+
public class BatterySavingActivity {
12+
13+
List<ApplicationInfo> packages;
14+
PackageManager pm;
15+
pm = getPackageManager();
16+
//get a list of installed apps.
17+
packages = pm.getInstalledApplications(0);
18+
19+
ActivityManager mActivityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
20+
21+
for (ApplicationInfo packageInfo : packages) {
22+
if((packageInfo.flags & ApplicationInfo.FLAG_SYSTEM)==1)continue;
23+
if(packageInfo.packageName.equals("mypackage")) continue;
24+
mActivityManager.killBackgroundProcesses(packageInfo.packageName);
25+
}
26+
27+
// ActivityManager actvityManager = (ActivityManager)
28+
// getApplicationContext().getSystemService( getApplicationContext().ACTIVITY_SERVICE );
29+
// List<ActivityManager.RunningAppProcessInfo> procInfos = actvityManager.getRunningAppProcesses();
30+
31+
// for(int pnum = 0; pnum < procInfos.size(); pnum++)
32+
// {
33+
// if((procInfos.get(pnum)).processName.contains("android")||(procInfos.get(pnum)).processName.contains("system")||(procInfos.get(pnum).processName.contains("xiaomi")||(procInfos.get(pnum)).processName.contains("huawei")||(procInfos.get(pnum)).processName.contains("adil"))
34+
// {
35+
// //Toast.makeText(getApplicationContext(), "system apps", Toast.LENGTH_SHORT).show();
36+
// }
37+
// else
38+
// {
39+
// actvityManager.killBackgroundProcesses(procInfos.get(pnum).processName);
40+
// Toast.makeText(getApplicationContext(), "killed "+procInfos.get(pnum).processName, Toast.LENGTH_SHORT).show();
41+
42+
// }
43+
// }
44+
}

app/src/main/java/com/yzy/supercleanmaster/ui/MemoryCleanActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public void onClickClear() {
260260
}
261261
}
262262
Allmemory = Allmemory - killAppmemory;
263-
T.showLong(mContext, "共清理" + StorageUtil.convertStorage(killAppmemory) + "内存");
263+
T.showLong(mContext, "Очищено " + StorageUtil.convertStorage(killAppmemory) + " памяти");
264264
if (Allmemory > 0) {
265265
refeshTextCounter();
266266
}

app/src/main/java/com/yzy/supercleanmaster/ui/SoftwareManageActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
133133

134134
public class MyPagerAdapter extends WeakFragmentPagerAdapter {
135135

136-
private final String[] TITLES = {"用户软件", "预装软件"};
136+
private final String[] TITLES = {"Программы пользователя", "Системные программы"};
137137

138138
public MyPagerAdapter(FragmentManager fm) {
139139
super(fm);
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:counter="http://schemas.android.com/apk/res-auto"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:orientation="vertical">
8+
9+
10+
<RelativeLayout
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent"
13+
android:orientation="vertical">
14+
15+
<RelativeLayout
16+
android:id="@+id/header"
17+
android:layout_width="match_parent"
18+
android:layout_height="80dip"
19+
android:background="@color/title_bg"
20+
android:visibility="gone"
21+
android:orientation="vertical">
22+
23+
<RelativeLayout
24+
android:layout_width="wrap_content"
25+
android:layout_centerInParent="true"
26+
android:layout_height="wrap_content">
27+
28+
<com.yzy.supercleanmaster.widget.textcounter.CounterView
29+
android:layout_width="wrap_content"
30+
android:layout_height="wrap_content"
31+
android:id="@+id/textCounter"
32+
android:textSize="48sp"
33+
android:text="250"
34+
android:textColor="@color/white"
35+
counter:autoStart="false" />
36+
37+
<TextView
38+
android:layout_marginTop="10dip"
39+
android:layout_marginLeft="@dimen/margin_right"
40+
android:layout_toRightOf="@+id/textCounter"
41+
android:id="@+id/sufix"
42+
android:layout_width="wrap_content"
43+
android:textColor="@color/white"
44+
android:text="KB"
45+
android:textSize="@dimen/text_size_middle"
46+
android:layout_height="wrap_content" />
47+
48+
<TextView
49+
android:layout_marginLeft="@dimen/margin_right"
50+
android:layout_marginTop="10dip"
51+
android:layout_toRightOf="@+id/textCounter"
52+
android:layout_below="@+id/sufix"
53+
android:layout_width="wrap_content"
54+
55+
android:textColor="@color/white"
56+
android:text="Может быть усыплено"
57+
android:textSize="@dimen/text_size_middle"
58+
android:layout_height="wrap_content" />
59+
60+
</RelativeLayout>
61+
62+
63+
</RelativeLayout>
64+
65+
<ListView
66+
android:layout_below="@+id/header"
67+
android:id="@+id/listview"
68+
android:layout_width="fill_parent"
69+
android:layout_height="fill_parent"
70+
android:fastScrollEnabled="true"
71+
android:focusable="true"
72+
android:listSelector="@android:color/transparent"
73+
android:scrollbars="none"
74+
android:clipToPadding="false"
75+
android:divider="@null"
76+
android:dividerHeight="4dp"
77+
android:fadingEdge="none"
78+
android:fitsSystemWindows="true"
79+
android:scrollbarStyle="outsideOverlay"
80+
android:padding="12dp" />
81+
82+
<TextView
83+
android:id="@+id/empty"
84+
android:layout_width="fill_parent"
85+
android:layout_height="fill_parent"
86+
android:gravity="center"
87+
android:text="@string/saving_battery"
88+
android:textAppearance="?android:attr/textAppearanceLarge" />
89+
90+
<LinearLayout
91+
92+
android:visibility="gone"
93+
android:orientation="horizontal"
94+
android:id="@+id/bottom_lin"
95+
android:layout_alignParentBottom="true"
96+
android:layout_width="match_parent"
97+
android:layout_height="wrap_content">
98+
99+
<Button
100+
android:id="@+id/clear_button"
101+
android:layout_width="match_parent"
102+
android:layout_height="wrap_content"
103+
android:layout_margin="8dip"
104+
android:background="@drawable/btn_normal_green"
105+
android:gravity="center"
106+
android:text="Усыпить"
107+
android:textColor="@color/white"
108+
android:textSize="@dimen/text_size_large" />
109+
</LinearLayout>
110+
111+
</RelativeLayout>
112+
113+
114+
<LinearLayout
115+
android:id="@+id/progressBar"
116+
android:layout_width="match_parent"
117+
android:layout_height="match_parent"
118+
android:background="?android:attr/windowBackground"
119+
android:gravity="center"
120+
android:orientation="vertical"
121+
android:visibility="gone">
122+
123+
<fr.castorflex.android.circularprogressbar.CircularProgressBar
124+
android:id="@+id/progressBar2"
125+
android:layout_width="50dip"
126+
android:layout_height="50dip"
127+
android:indeterminate="true"
128+
app:cpb_colors="@array/gplus_colors" />
129+
130+
<TextView
131+
android:id="@+id/progressBarText"
132+
android:layout_width="wrap_content"
133+
android:layout_height="wrap_content"
134+
android:paddingTop="4dip"
135+
android:singleLine="true"
136+
android:text="@string/scanning"
137+
android:textAppearance="?android:attr/textAppearanceSmall" />
138+
139+
</LinearLayout>
140+
141+
</FrameLayout>

app/src/main/res/layout/activity_memory_clean.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
android:layout_below="@+id/sufix"
6767
android:layout_width="wrap_content"
6868
android:textColor="@color/white"
69-
android:text="可清理内存"
69+
android:text="Памяти"
7070
android:textSize="@dimen/text_size_middle"
7171
android:layout_height="wrap_content" />
7272

@@ -109,7 +109,7 @@
109109
android:textSize="@dimen/text_size_large"
110110
android:layout_width="match_parent"
111111
android:gravity="center"
112-
android:text="一键清理"
112+
android:text="Освободить"
113113
android:layout_height="wrap_content" />
114114
</LinearLayout>
115115

app/src/main/res/layout/fragment_main.xml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,56 @@
1111
android:layout_weight="0.3">
1212

1313
<RelativeLayout
14-
android:layout_width="286dp"
15-
android:layout_height="206dp"
14+
android:layout_width="335dp"
15+
android:layout_height="269dp"
1616
android:layout_alignParentTop="true"
17-
android:layout_centerHorizontal="true"
18-
android:layout_marginTop="0dp">
17+
android:layout_centerHorizontal="true">
1918

2019
<RelativeLayout
2120
android:id="@+id/arc_left"
22-
android:layout_width="102dp"
23-
android:layout_height="91dp"
21+
android:layout_width="150dp"
22+
android:layout_height="150dp"
2423
android:layout_centerVertical="true">
2524

2625
<com.yzy.supercleanmaster.widget.circleprogress.ArcProgress
2726
android:id="@+id/arc_store"
2827
android:layout_width="150dp"
2928
android:layout_height="150dp"
29+
3030
android:layout_alignParentStart="true"
3131
android:layout_alignParentTop="true"
32-
custom:arc_bottom_text="Место для хранения"
33-
custom:arc_bottom_text_size="5dp"
32+
custom:arc_bottom_text="Занято"
33+
custom:arc_bottom_text_size="10dp"
3434
custom:arc_progress="10"
3535
custom:arc_stroke_width="8dip"
3636
custom:arc_text_color="#ffffff"
37-
custom:arc_text_size="16dp" />
37+
custom:arc_text_size="30dp" />
3838

3939
<TextView
4040
android:id="@+id/capacity"
4141
android:layout_width="wrap_content"
4242
android:layout_height="wrap_content"
4343
android:layout_alignParentBottom="true"
4444
android:layout_centerHorizontal="true"
45-
android:layout_marginBottom="55dip"
45+
android:layout_marginBottom="47dp"
4646
android:text="20/30"
4747
android:textColor="@color/white"
48-
android:textSize="10dip" />
48+
android:textSize="8dip" />
4949
</RelativeLayout>
5050

5151
<com.yzy.supercleanmaster.widget.circleprogress.ArcProgress
5252
android:id="@+id/arc_process"
53-
android:layout_width="69dp"
54-
android:layout_height="69dp"
53+
android:layout_width="113dp"
54+
android:layout_height="112dp"
5555
android:layout_alignParentEnd="true"
5656
android:layout_centerVertical="true"
57-
android:layout_marginEnd="49dp"
58-
custom:arc_bottom_text="Память"
59-
custom:arc_bottom_text_size="7dp"
57+
android:layout_marginEnd="36dp"
58+
custom:arc_bottom_text="Занято памяти"
59+
custom:arc_bottom_text_size="8dp"
6060
custom:arc_progress="10"
6161
custom:arc_stroke_width="6dip"
6262
custom:arc_text_color="#ffffff"
63-
custom:arc_text_size="16dip" />
63+
custom:arc_text_size="30dip" />
6464
</RelativeLayout>
6565

6666

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<string name="app_software_manage">Удаление программ</string>
1616
<string name="cleaned">Очистка мусора(<xliff:g id="memory">%1$s</xliff:g>)</string>
1717
<string name="empty_cache">Поздравляю! Память освобождена!</string>
18+
<string name="saving_battery">Поздравляю! Вы сэкономили заряд батареи!</string>
1819
<string name="scanning">Сканирование ...</string>
1920
<string name="scanning_m_of_n">Сканирование %1$d/%2$d</string>
2021
<string name="software_top_text">Был установлен%1$sПрограммное обеспечение, занимающее место для хранения%2$s</string>

0 commit comments

Comments
 (0)