Commit aa29a42b authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 91b3cb28
...@@ -227,6 +227,9 @@ ...@@ -227,6 +227,9 @@
android:name=".ui.activitys.KylVedioActivity" android:name=".ui.activitys.KylVedioActivity"
android:configChanges="orientation|screenSize|keyboardHidden" android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".call.detail.DetailActivity" />
<activity android:name=".call.permission.PermissionActivity" />
<activity android:name=".call.detail.DetailApplyActivity" />
<service <service
android:name=".service.UpdateService" android:name=".service.UpdateService"
......
...@@ -8,6 +8,7 @@ import android.text.TextUtils; ...@@ -8,6 +8,7 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.mints.goodmoney.call.provider.CallProvider; import com.mints.goodmoney.call.provider.CallProvider;
import com.mints.goodmoney.common.Constant;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -19,7 +20,7 @@ import java.util.regex.Pattern; ...@@ -19,7 +20,7 @@ import java.util.regex.Pattern;
public class VideoDBHelper { public class VideoDBHelper {
public static final String UNKNOWN_NUMBER = "unknown"; public static final String UNKNOWN_NUMBER = "unknown";
private static final String AUTHORITY = "content://com.hearing.calltest.provider"; private static final String AUTHORITY = "content://" + Constant.MINTS_PKG_NAME + ".provider";
private static final Uri VIDEO_URI = Uri.parse(AUTHORITY); private static final Uri VIDEO_URI = Uri.parse(AUTHORITY);
......
...@@ -94,7 +94,7 @@ public class DetailActivity extends AppCompatActivity { ...@@ -94,7 +94,7 @@ public class DetailActivity extends AppCompatActivity {
public void setRingtone(View view) { public void setRingtone(View view) {
mSetRingtone = !mSetRingtone; mSetRingtone = !mSetRingtone;
// ((ImageView) view).setImageResource(mSetRingtone ? R.drawable.ringtone_set : R.drawable.ringtone_close); ((ImageView) view).setImageResource(mSetRingtone ? R.mipmap.ringtone_set : R.mipmap.ringtone_close);
} }
public void setContact(View view) { public void setContact(View view) {
......
...@@ -6,10 +6,12 @@ import android.net.Uri; ...@@ -6,10 +6,12 @@ import android.net.Uri;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.mints.goodmoney.common.Constant;
public class PreferenceUtil { public class PreferenceUtil {
public static final String METHOD_CONTAIN_KEY = "method_contain_key"; public static final String METHOD_CONTAIN_KEY = "method_contain_key";
public static final String AUTHORITY = "com.hearing.calltest"; public static final String AUTHORITY = Constant.MINTS_PKG_NAME;
public static final Uri URI = Uri.parse("content://" + AUTHORITY); public static final Uri URI = Uri.parse("content://" + AUTHORITY);
public static final String METHOD_QUERY_VALUE = "method_query_value"; public static final String METHOD_QUERY_VALUE = "method_query_value";
public static final String METHOD_EIDIT_VALUE = "method_edit"; public static final String METHOD_EIDIT_VALUE = "method_edit";
......
...@@ -10,10 +10,11 @@ import com.downloader.OnDownloadListener ...@@ -10,10 +10,11 @@ import com.downloader.OnDownloadListener
import com.downloader.PRDownloader import com.downloader.PRDownloader
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.ad.vedio.VedioAdingManager import com.mints.goodmoney.ad.vedio.VedioAdingManager
import com.mints.goodmoney.call.detail.DetailActivity
import com.mints.goodmoney.call.util.Util
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.VedioAdingBean import com.mints.goodmoney.mvp.model.VedioAdingBean
import com.mints.goodmoney.mvp.presenters.GamePresenter
import com.mints.goodmoney.mvp.presenters.KylVedioPresenter import com.mints.goodmoney.mvp.presenters.KylVedioPresenter
import com.mints.goodmoney.mvp.views.KylVedioView import com.mints.goodmoney.mvp.views.KylVedioView
import com.mints.goodmoney.ui.activitys.base.BaseActivity import com.mints.goodmoney.ui.activitys.base.BaseActivity
...@@ -43,6 +44,7 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView { ...@@ -43,6 +44,7 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView {
private var downloadId: Int = -1//vedio下载id private var downloadId: Int = -1//vedio下载id
private var downloadVedioSucFlag = false// 下载视频成功 private var downloadVedioSucFlag = false// 下载视频成功
private var cachePath = ""// cache路径 private var cachePath = ""// cache路径
private var vedioPath = ""// vedio路径
private var vedioName = ""// 视频名称 private var vedioName = ""// 视频名称
...@@ -64,6 +66,11 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView { ...@@ -64,6 +66,11 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView {
return return
} }
cachePath = cacheDir.path + "/" cachePath = cacheDir.path + "/"
try {
vedioPath = getExternalFilesDir(null)!!.absolutePath + "/video/"
} catch (e: java.lang.Exception) {
vedioPath = filesDir.absolutePath + "/video/"
}
vedioAdingManager = VedioAdingManager.getInstance(this) vedioAdingManager = VedioAdingManager.getInstance(this)
initListener() initListener()
loadVedio(vedioUrl) loadVedio(vedioUrl)
...@@ -210,8 +217,14 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView { ...@@ -210,8 +217,14 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView {
if (downloadVedioSucFlag) { if (downloadVedioSucFlag) {
LogUtil.d("KylVedioActivity", "name:-->" + cachePath + vedioName) LogUtil.d("KylVedioActivity", "name:-->" + cachePath + vedioName)
try { try {
showToast("设置壁纸成功") // showToast("设置壁纸成功")
videoWallpaper.setToWallPaper(this, cachePath + vedioName) videoWallpaper.setToWallPaper(this, cachePath + vedioName)
// val cacheName = cachePath + vedioName
// val vedioName = vedioPath + vedioName
// Thread(Runnable {
// Util.CopyAssets(this, cacheName, vedioName)
// }).start()
// DetailActivity.startSelf(this, vedioName)
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
......
...@@ -76,20 +76,20 @@ class KuYinYuePageFragment(private val targetid: String) : LazyLoadBaseFragment( ...@@ -76,20 +76,20 @@ class KuYinYuePageFragment(private val targetid: String) : LazyLoadBaseFragment(
} }
override fun getXfPageMsgSuc(data: KylVedioBean) { override fun getXfPageMsgSuc(data: KylVedioBean) {
// if (::kylPageAdapter.isInitialized) { if (::kylPageAdapter.isInitialized) {
// kylData.addAll(data.data) kylData.addAll(data.data)
// if (curPage == 1) { if (curPage == 1) {
// srl_kyl.finishRefresh(true) srl_kyl.finishRefresh(true)
// kylPageAdapter.notifyDataSetChanged() kylPageAdapter.notifyDataSetChanged()
// } else { } else {
// if (data.data.size < PAGE_SIZE) { if (data.data.size < PAGE_SIZE) {
// srl_kyl.finishLoadMoreWithNoMoreData() srl_kyl.finishLoadMoreWithNoMoreData()
// } else { } else {
// srl_kyl.finishLoadMore() srl_kyl.finishLoadMore()
// } }
// kylPageAdapter.notifyItemChanged(data.data.size) kylPageAdapter.notifyItemChanged(data.data.size)
// } }
// } }
} }
override fun getXfPageMsgFail() { override fun getXfPageMsgFail() {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
android:layout_alignParentBottom="true"> android:layout_alignParentBottom="true">
<ImageView <ImageView
android:visibility="gone"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
...@@ -29,10 +30,11 @@ ...@@ -29,10 +30,11 @@
android:layout_height="45dp" android:layout_height="45dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:gravity="center" android:gravity="center"
android:text="show" android:text="设置"
android:onClick="setShow"/> android:onClick="setShow"/>
<ImageView <ImageView
android:visibility="gone"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
android:layout_marginStart="40dp" android:layout_marginStart="40dp"
android:layout_marginEnd="40dp" android:layout_marginEnd="40dp"
android:gravity="center" android:gravity="center"
android:text="@string/permission_tip"
android:textColor="@color/colorAccent" android:textColor="@color/colorAccent"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -28,6 +29,7 @@ ...@@ -28,6 +29,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.7" android:layout_weight="0.7"
android:text="@string/sdcard_permission"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" /> android:textSize="20sp" />
...@@ -36,7 +38,8 @@ ...@@ -36,7 +38,8 @@
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.3" /> android:layout_weight="0.3"
android:src="@mipmap/no_permission" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -51,6 +54,7 @@ ...@@ -51,6 +54,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.7" android:layout_weight="0.7"
android:text="@string/phone_permission"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" /> android:textSize="20sp" />
...@@ -59,7 +63,8 @@ ...@@ -59,7 +63,8 @@
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.3" /> android:layout_weight="0.3"
android:src="@mipmap/no_permission" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -74,6 +79,7 @@ ...@@ -74,6 +79,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.7" android:layout_weight="0.7"
android:text="@string/float_permission"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" /> android:textSize="20sp" />
...@@ -82,7 +88,8 @@ ...@@ -82,7 +88,8 @@
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.3" /> android:layout_weight="0.3"
android:src="@mipmap/no_permission" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -97,6 +104,7 @@ ...@@ -97,6 +104,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.7" android:layout_weight="0.7"
android:text="@string/notification_permission"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" /> android:textSize="20sp" />
...@@ -105,7 +113,8 @@ ...@@ -105,7 +113,8 @@
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.3" /> android:layout_weight="0.3"
android:src="@mipmap/no_permission" />
</LinearLayout> </LinearLayout>
<TextView <TextView
...@@ -117,6 +126,7 @@ ...@@ -117,6 +126,7 @@
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingEnd="30dp" android:paddingEnd="30dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:text="@string/get_permission"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" android:textSize="20sp"
android:onClick="getPermission"/> android:onClick="getPermission"/>
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="4dp" android:layout_margin="4dp"
android:background="@color/white" android:background="@color/white"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.shehuan.niv.NiceImageView
android:id="@+id/ivKylPage" android:id="@+id/ivKylPage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="300dp"
......
...@@ -26,4 +26,12 @@ ...@@ -26,4 +26,12 @@
<string name="register_name">用户注册协议</string> <string name="register_name">用户注册协议</string>
<string name="privacy_name">用户隐私协议</string> <string name="privacy_name">用户隐私协议</string>
<string name="permission_tip">为了正常使用来电秀,请允许以下权限。</string>
<string name="sdcard_permission">读写权限</string>
<string name="phone_permission">电话权限</string>
<string name="float_permission">悬浮窗权限</string>
<string name="notification_permission">通知权限</string>
<string name="get_permission">获取权限</string>
</resources> </resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment