Skip to content

Commit

Permalink
Merge pull request #35 from lianglixin/functional
Browse files Browse the repository at this point in the history
Functional
  • Loading branch information
lianglixin committed May 17, 2019
2 parents 5da4c2f + 152653d commit ff933c5
Show file tree
Hide file tree
Showing 31 changed files with 666 additions and 465 deletions.
6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId "io.virtualapp.sandvxposed"
minSdkVersion 19
targetSdkVersion 26
versionCode 35
versionName "1.2.5.1.3.1.1.6"
versionCode 36
versionName "1.2.5.1.3.1.1.7"
multiDexEnabled true
android {
defaultConfig {
Expand Down Expand Up @@ -80,6 +80,8 @@ dependencies {
implementation 'com.kyleduo.switchbutton:library:1.4.6'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
annotationProcessor 'com.trend.lazyinject:compiler:3.4.0-beta'

// TX移动统计,非必要,大家可在构建的时候删掉
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":35,"versionName":"1.2.5.1.3.1.1.6","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":36,"versionName":"1.2.5.1.3.1.1.7","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
21 changes: 13 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,22 @@
<application
android:name=".VApp"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:fullBackupContent="@xml/backup_descriptor">
android:theme="@style/AppTheme">
<activity android:name="com.sk.vloc.VLocSetting" />

<service
android:name="sk.vpkg.live.WhiteService"
android:enabled="true"
android:exported="true" />

<provider
android:authorities="sk.vpkg.provider.BanNotificationProvider"
android:name="sk.vpkg.provider.BanNotificationProvider"
android:readPermission="sk.vpkg.provider.READ"
android:exported="true">
</provider>
android:authorities="sk.vpkg.provider.BanNotificationProvider"
android:exported="true"
android:readPermission="sk.vpkg.provider.READ" />

<service
android:name="com.sk.fwindow.skFloattingWin"
Expand Down Expand Up @@ -75,10 +79,11 @@
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

<!--category android:name="android.intent.category.HOME" /-->
<!--category android:name="android.intent.category.DEFAULT" /-->
<!-- category android:name="android.intent.category.HOME" / -->
<!-- category android:name="android.intent.category.DEFAULT" / -->
</intent-filter>
</activity>
<activity
Expand Down
69 changes: 55 additions & 14 deletions app/src/main/java/io/virtualapp/home/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.lody.virtual.os.VUserInfo;
import com.lody.virtual.os.VUserManager;
import com.sk.fwindow.skFloattingWin;
import com.sk.vloc.VLocSetting;

import java.io.File;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -84,8 +85,10 @@ public class HomeActivity extends VActivity implements HomeContract.HomeView {
private View mMenuView;
private PopupMenu mPopupMenu;
private View mBottomArea;
private View mRenameArea;
private View mCreateShortcutBox;
private TextView mCreateShortcutTextView;
private TextView mRenameTextView;
private View mDeleteAppBox;
private TextView mDeleteAppTextView;
private LaunchpadAdapter mLaunchpadAdapter;
Expand Down Expand Up @@ -182,7 +185,8 @@ private void initMenu() {
});
*/
menu.add("虚拟位置").setIcon(R.drawable.ic_notification).setOnMenuItemClickListener(item -> {
startActivity(new Intent(this, VirtualLocationSettings.class));
// startActivity(new Intent(this, VirtualLocationSettings.class));
startActivity(new Intent(this, VLocSetting.class));
return true;
});
menu.add("设置").setIcon(R.drawable.ic_settings).setOnMenuItemClickListener(item -> {
Expand Down Expand Up @@ -225,8 +229,10 @@ private void bindViews() {
mLauncherView = (RecyclerView) findViewById(R.id.home_launcher);
mMenuView = findViewById(R.id.home_menu);
mBottomArea = findViewById(R.id.bottom_area);
mRenameArea = findViewById(R.id.rename_area);
mCreateShortcutBox = findViewById(R.id.create_shortcut_area);
mCreateShortcutTextView = (TextView) findViewById(R.id.create_shortcut_text);
mRenameTextView = (TextView) findViewById(R.id.rename_app_text);
mDeleteAppBox = findViewById(R.id.delete_app_area);
mDeleteAppTextView = (TextView) findViewById(R.id.delete_app_text);
// 搜索
Expand Down Expand Up @@ -305,11 +311,6 @@ public boolean onQueryTextChange(String newText)
return false;
}
});
if (Once.beenDone("app_force_live"))
{
Intent intent = new Intent(HomeActivity.this, MakeMeLive.class);
startService(intent);
}
SwipeRefreshLayout hRefreshControl = findViewById(R.id.swipeRefreshDesktop_HomeAct);
hRefreshControl.setOnRefreshListener(() ->
{
Expand Down Expand Up @@ -393,6 +394,9 @@ public void showBottomAction() {
mBottomArea.setTranslationY(mBottomArea.getHeight());
mBottomArea.setVisibility(View.VISIBLE);
mBottomArea.animate().translationY(0).setDuration(500L).start();
mRenameArea.setTranslationY(mBottomArea.getHeight());
mRenameArea.setVisibility(View.VISIBLE);
mRenameArea.animate().translationY(0).setDuration(500L).start();
}

@Override
Expand Down Expand Up @@ -422,6 +426,31 @@ public void onAnimationRepeat(Animator animator) {
});
transAnim.setDuration(500L);
transAnim.start();
mRenameArea.setTranslationY(0);
ObjectAnimator transAnim2 = ObjectAnimator.ofFloat(mRenameArea, "translationY", 0, mRenameArea.getHeight());
transAnim2.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {

}

@Override
public void onAnimationEnd(Animator animator) {
mRenameArea.setVisibility(View.GONE);
}

@Override
public void onAnimationCancel(Animator animator) {
mRenameArea.setVisibility(View.GONE);
}

@Override
public void onAnimationRepeat(Animator animator) {

}
});
transAnim2.setDuration(500L);
transAnim2.start();
}

@Override
Expand Down Expand Up @@ -488,13 +517,10 @@ public void askInstallGms() {
new AlertDialog.Builder(this)
.setTitle("欢迎使用")
.setMessage("你好,我们在您的手机上查找到了谷歌服务,需要将谷歌服务添加到本应用当中吗?")
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
defer().when(() -> {
GmsSupport.installGApps(0);
}).done((res) -> {
mPresenter.dataChanged();
});
})
.setPositiveButton(android.R.string.ok, (dialog, which) -> defer().when(
() ->
GmsSupport.installGApps(0)
).done((res) -> mPresenter.dataChanged()))
.setNegativeButton(android.R.string.cancel, (dialog, which) ->
Toast.makeText(HomeActivity.this,
"以后您也可以在设置里面添加谷歌服务。", Toast.LENGTH_LONG).show())
Expand Down Expand Up @@ -660,6 +686,7 @@ public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHol
} else if (upAtDeleteAppArea) {
deleteApp(viewHolder.getAdapterPosition());
}
// TODO: Rename application......
}
dragHolder = null;
}
Expand Down Expand Up @@ -697,11 +724,25 @@ public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHo
mDeleteAppTextView.setTextColor(Color.parseColor("#0099cc"));
mCreateShortcutTextView.setTextColor(Color.WHITE);
}
} else {
} else if(y >= baseLine - mRenameArea.getHeight())
{
// TODO rename app
int deleteAppAreaStartX = location[0];
if (x < deleteAppAreaStartX)
{
mRenameTextView.setTextColor(Color.parseColor("#0099cc"));
}
else
{
mRenameTextView.setTextColor(Color.WHITE);
}
}
else{
upAtCreateShortcutArea = false;
upAtDeleteAppArea = false;
mDeleteAppTextView.setTextColor(Color.WHITE);
mCreateShortcutTextView.setTextColor(Color.WHITE);
mRenameTextView.setTextColor(Color.WHITE);
}
}
}
Expand Down
29 changes: 25 additions & 4 deletions app/src/main/java/io/virtualapp/home/SettingAct.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
import android.view.MenuItem;
import android.widget.Toast;

import com.lody.virtual.client.core.VirtualCore;
import com.lody.virtual.client.ipc.VActivityManager;
import com.sk.app.SettingUtils;
import com.sk.fwindow.skFloattingWin;
import com.sk.listapp.XAppManager;

import java.util.List;

import io.virtualapp.R;
import jonathanfinerty.once.Once;
import sk.vpkg.live.WhiteService;
import sk.vpkg.provider.BanNotificationProvider;

/**
Expand Down Expand Up @@ -406,8 +409,16 @@ public void onCreate(Bundle savedInstanceState)
}
try
{
Intent intent = new Intent(getActivity(), MakeMeLive.class);
getActivity().stopService(intent);
String ismakeMeLiveEnable = BanNotificationProvider.getString(
VirtualCore.get().getContext(),
"makeMeLive"
);
if(ismakeMeLiveEnable!=null)
{
BanNotificationProvider.remove(VirtualCore.get().getContext(),
"makeMeLive"
);
}
}
catch (Throwable e)
{
Expand All @@ -423,8 +434,18 @@ public void onCreate(Bundle savedInstanceState)
}
try
{
Intent intent = new Intent(getActivity(), MakeMeLive.class);
getActivity().startService(intent);
String ismakeMeLiveEnable = BanNotificationProvider.getString(
VirtualCore.get().getContext(),
"makeMeLive"
);
if(ismakeMeLiveEnable==null)
{
BanNotificationProvider.save(VirtualCore.get().getContext(),
"makeMeLive",
"Enabled"
);
}
SettingUtils.enterWhiteListSetting(VirtualCore.get().getContext());
}catch (Throwable e)
{
e.printStackTrace();
Expand Down
Loading

0 comments on commit ff933c5

Please sign in to comment.