Skip to content

Commit 96238f2

Browse files
committed
Fix bugs
1 parent 5f413dd commit 96238f2

File tree

100 files changed

+161
-15061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+161
-15061
lines changed

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ android {
66

77
defaultConfig {
88
applicationId "com.balaganovrocks.yourmastercleaner"
9-
minSdkVersion 14
9+
minSdkVersion 16
1010
targetSdkVersion 27
1111
versionCode 3
1212
versionName "1.0"
@@ -27,6 +27,7 @@ dependencies {
2727
// Опционально. Библиотека Play Install Referrer.
2828
implementation 'com.android.installreferrer:installreferrer:1.0'
2929
implementation 'com.android.support:appcompat-v7:27.0.0'
30+
implementation "com.android.support:support-compat:27.0.0"
3031
implementation 'com.jakewharton:butterknife:6.0.0'
3132
implementation 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
3233
implementation 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'

app/src/main/AndroidManifest.xml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,20 @@
4949
</intent-filter>
5050
</activity>
5151
<activity
52-
android:screenOrientation="portrait"
53-
android:name="com.balaganovrocks.yourmastercleaner.ui.MainActivity"
54-
android:label="@string/app_name"
55-
android:theme="@style/MyAppTheme"></activity>
52+
android:screenOrientation="portrait"
53+
android:name="com.balaganovrocks.yourmastercleaner.ui.MainActivity"
54+
android:label="@string/app_name"
55+
android:theme="@style/MyAppTheme" />
56+
<activity
57+
android:screenOrientation="portrait"
58+
android:name="com.balaganovrocks.yourmastercleaner.ui.BatterySavingActivity"
59+
android:label="@string/app_name"
60+
android:theme="@style/MyAppTheme" />
5661
<activity
5762
android:screenOrientation="portrait"
5863
android:name="com.balaganovrocks.yourmastercleaner.ui.Privacy_Policy"
5964
android:label="@string/app_name"
60-
android:theme="@style/MyAppTheme"></activity>
65+
android:theme="@style/MyAppTheme" />
6166
<activity
6267
android:screenOrientation="portrait"
6368
android:name="com.balaganovrocks.yourmastercleaner.ui.ShortCutActivity"
@@ -72,48 +77,48 @@
7277
</intent-filter>
7378
</activity>
7479
<activity
75-
android:screenOrientation="portrait"
76-
android:name="com.balaganovrocks.yourmastercleaner.ui.MemoryCleanActivity"
77-
android:label="@string/app_memory_clean"
78-
android:theme="@style/MyTranslucentAppTheme"></activity>
80+
android:screenOrientation="portrait"
81+
android:name="com.balaganovrocks.yourmastercleaner.ui.MemoryCleanActivity"
82+
android:label="@string/app_memory_clean"
83+
android:theme="@style/MyTranslucentAppTheme" />
7984

8085
<activity
8186
android:screenOrientation="portrait"
8287
android:name="com.balaganovrocks.yourmastercleaner.ui.settings"
8388
android:label="@string/app_memory_clean"
84-
android:theme="@style/MyTranslucentAppTheme"></activity>
89+
android:theme="@style/MyTranslucentAppTheme" />
8590
<activity
8691
android:screenOrientation="portrait"
8792
android:name="com.balaganovrocks.yourmastercleaner.ui.Exit"
8893
android:label="@string/app_memory_clean"
89-
android:theme="@style/MyTranslucentAppTheme"></activity>
94+
android:theme="@style/MyTranslucentAppTheme" />
9095

9196
<activity
9297
android:screenOrientation="portrait"
9398
android:name="com.balaganovrocks.yourmastercleaner.ui.RubbishCleanActivity"
9499
android:label="@string/app_rublish_clean"
95-
android:theme="@style/MyTranslucentAppTheme"></activity>
100+
android:theme="@style/MyTranslucentAppTheme" />
96101

97102
<activity
98103
android:screenOrientation="portrait"
99104
android:name="com.balaganovrocks.yourmastercleaner.ui.AutoStartManageActivity"
100105
android:label="@string/app_autostart_manage"
101-
android:theme="@style/MyTranslucentAppTheme"></activity>
106+
android:theme="@style/MyTranslucentAppTheme" />
102107

103108
<activity
104109
android:screenOrientation="portrait"
105110
android:name="com.balaganovrocks.yourmastercleaner.ui.SoftwareManageActivity"
106111
android:label="@string/app_software_manage"
107-
android:theme="@style/MyTranslucentAppTheme"></activity>
112+
android:theme="@style/MyTranslucentAppTheme" />
108113

109114
<activity
110115
android:screenOrientation="portrait"
111116
android:name="com.balaganovrocks.yourmastercleaner.base.FragmentContainerActivity"
112-
android:theme="@style/MyTranslucentAppTheme"></activity>
117+
android:theme="@style/MyTranslucentAppTheme" />
113118
<activity
114119
android:screenOrientation="portrait"
115120
android:name="com.balaganovrocks.yourmastercleaner.ui.AboutActivity"
116-
android:theme="@style/MyTranslucentAppTheme"></activity>
121+
android:theme="@style/MyTranslucentAppTheme" />
117122

118123
<service
119124
android:name="com.balaganovrocks.yourmastercleaner.service.CleanerService"

app/src/main/java/com/yzy/supercleanmaster/adapter/ClearMemoryAdapter.java renamed to app/src/main/java/com/balaganovrocks/yourmastercleaner/adapter/BatterySavingAdapter.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.yzy.supercleanmaster.adapter;
1+
package com.balaganovrocks.yourmastercleaner.adapter;
22

33
import android.content.Context;
44
import android.view.LayoutInflater;
@@ -10,21 +10,21 @@
1010
import android.widget.RelativeLayout;
1111
import android.widget.TextView;
1212

13-
import com.yzy.supercleanmaster.R;
14-
import com.yzy.supercleanmaster.bean.AppProcessInfo;
15-
import com.yzy.supercleanmaster.utils.StorageUtil;
13+
import com.balaganovrocks.yourmastercleaner.R;
14+
import com.balaganovrocks.yourmastercleaner.bean.AppProcessInfo;
15+
import com.balaganovrocks.yourmastercleaner.utils.StorageUtil;
1616

1717
import java.util.ArrayList;
1818
import java.util.List;
1919

20-
public class ClearMemoryAdapter extends BaseAdapter {
20+
public class BatterySavingAdapter extends BaseAdapter {
2121

2222
public List<AppProcessInfo> mlistAppInfo;
2323
LayoutInflater infater = null;
2424
private Context mContext;
2525
public static List<Integer> clearIds;
2626

27-
public ClearMemoryAdapter(Context context, List<AppProcessInfo> apps) {
27+
public BatterySavingAdapter(Context context, List<AppProcessInfo> apps) {
2828
infater = LayoutInflater.from(context);
2929
mContext = context;
3030
clearIds = new ArrayList<Integer>();
@@ -53,15 +53,15 @@ public long getItemId(int position) {
5353
public View getView(int position, View convertView, ViewGroup parent) {
5454
ViewHolder holder = null;
5555
if (convertView == null) {
56-
convertView = infater.inflate(R.layout.listview_memory_clean,
56+
convertView = infater.inflate(R.layout.listview_battery_saving,
5757
null);
5858
holder = new ViewHolder();
5959
holder.appIcon = (ImageView) convertView
6060
.findViewById(R.id.image);
6161
holder.appName = (TextView) convertView
6262
.findViewById(R.id.name);
63-
holder.memory = (TextView) convertView
64-
.findViewById(R.id.memory);
63+
// holder.memory = (TextView) convertView
64+
// .findViewById(R.id.memory);
6565

6666
holder.cb = (RadioButton) convertView
6767
.findViewById(R.id.choice_radio);
@@ -72,7 +72,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
7272
final AppProcessInfo appInfo = (AppProcessInfo) getItem(position);
7373
holder.appIcon.setImageDrawable(appInfo.icon);
7474
holder.appName.setText(appInfo.appName);
75-
holder.memory.setText(StorageUtil.convertStorage(appInfo.memory));
75+
// holder.memory.setText(StorageUtil.convertStorage(appInfo.memory));
7676
if (appInfo.checked) {
7777
holder.cb.setChecked(true);
7878
} else {
@@ -111,3 +111,4 @@ public void setCb(RadioButton cb) {
111111
}
112112

113113
}
114+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package com.balaganovrocks.yourmastercleaner.ui;
2+
3+
import android.app.Notification;
4+
import android.app.NotificationManager;
5+
import android.app.PendingIntent;
6+
import android.app.TaskStackBuilder;
7+
import android.content.Context;
8+
import android.content.Intent;
9+
import android.os.Bundle;
10+
import android.support.v4.app.NotificationCompat;
11+
import android.support.v7.app.AppCompatActivity;
12+
import android.view.View;
13+
14+
import com.balaganovrocks.yourmastercleaner.R;
15+
16+
import static android.content.Context.NOTIFICATION_SERVICE;
17+
18+
public class Notifications extends AppCompatActivity {
19+
@Override
20+
protected void onCreate(Bundle savedInstanceState) {
21+
super.onCreate(savedInstanceState);
22+
setContentView(R.layout.activity_main);
23+
}
24+
25+
public void sendNotification() {
26+
27+
long itemId = 12345678910L;
28+
int notificationId = ((Long) itemId).intValue();
29+
30+
// Create PendingIntent
31+
Intent resultIntent = new Intent(this, MainActivity.class);
32+
resultIntent.putExtra("hello", itemId);
33+
34+
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
35+
stackBuilder.addParentStack(MainActivity.class);
36+
stackBuilder.addNextIntent(resultIntent);
37+
38+
PendingIntent resultPendingIntent =
39+
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
40+
41+
// Create Notification
42+
NotificationCompat.Builder builder =
43+
new NotificationCompat.Builder(this)
44+
.setSmallIcon(R.drawable.ic_launcher)
45+
.setContentTitle("Title")
46+
.setContentText("Notification text")
47+
.setContentIntent(resultPendingIntent);
48+
49+
Notification notification = builder.build();
50+
51+
// Show Notification
52+
NotificationManager notificationManager =
53+
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
54+
notificationManager.notify(notificationId, notification);
55+
}
56+
}

0 commit comments

Comments
 (0)