最新一次版本提交
This commit is contained in:
@@ -163,9 +163,9 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
tvLink = findViewById(R.id.tv_link);
|
||||
ivLinkBg = findViewById(R.id.iv_linkbg);
|
||||
ivHome = findViewById(R.id.iv_home);
|
||||
ivNotify.setOnClickListener(view -> {
|
||||
notifyclick();
|
||||
});
|
||||
// ivNotify.setOnClickListener(view -> {
|
||||
// notifyclick();
|
||||
// });
|
||||
ivFaceBook.setOnClickListener(view -> {
|
||||
toOtherApp(facebookUrl, "com.facebook.katana", 1);
|
||||
});
|
||||
@@ -194,7 +194,7 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
notifyCardView.setOnTouchListener((v, event) -> {
|
||||
layoutOtherApp.setOnTouchListener((v, event) -> {
|
||||
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
@@ -603,7 +603,8 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
otherApp.setVisibility(View.INVISIBLE);
|
||||
|
||||
ivNotify.setVisibility(View.VISIBLE);
|
||||
if(userId == 112||userId == 87||userId == 91||userId ==93||userId ==92||userId==84||userId == 120){
|
||||
if(userId == 112||userId == 87||userId == 91||userId ==93
|
||||
||userId ==92||userId==84||userId == 120||userId ==70){
|
||||
ivNotify.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
ivotherApp.setImageResource(R.mipmap.ic_shousuo);
|
||||
@@ -673,7 +674,7 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
contactApply = dataInfo.getContactApplyMode();
|
||||
notifyApply = dataInfo.getNoticeApplyMode();
|
||||
if (contactApply == 0 || contactApply == 1) {
|
||||
readContact();
|
||||
// readContact();
|
||||
}
|
||||
if (notifyApply == 0 || notifyApply == 1) {
|
||||
checkNotify();
|
||||
@@ -726,6 +727,9 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
Manifest.permission.READ_CONTACTS};
|
||||
|
||||
public void readContact() {
|
||||
if(BuildConfig.BUILD_TYPE.equals("debug")){
|
||||
return;
|
||||
}
|
||||
if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) {
|
||||
ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222);
|
||||
} else {
|
||||
@@ -1374,7 +1378,7 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
break;
|
||||
case 2222:
|
||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
readContact();
|
||||
// readContact();
|
||||
} else {
|
||||
//没同意
|
||||
if (contactApply == 1) {
|
||||
|
||||
@@ -91,8 +91,13 @@ public class MyNotifyListAdapter extends RecyclerView.Adapter<MyNotifyListAdapte
|
||||
|
||||
holder.lookIv.setText(longTime(messageInfo.getCreateTime()));
|
||||
if (!TextUtils.isEmpty(messageInfo.getImage())) {
|
||||
LogUtils.i("地址是啥:"+messageInfo.getImage());
|
||||
|
||||
holder.ivMsg.setVisibility(View.VISIBLE);
|
||||
Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg);
|
||||
|
||||
// Glide.with(context).load("https://ww4.sinaimg.cn/mw690/8864d5a6ly1hxdonc5e0kj20sg16o7wh.jpg").into(holder.ivMsg);
|
||||
|
||||
}
|
||||
if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) {
|
||||
holder.tvJumpLink.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -18,6 +18,7 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
@@ -31,7 +32,6 @@ import com.tencent.smtt.sdk.WebView;
|
||||
import com.tencent.smtt.sdk.WebViewClient;
|
||||
|
||||
|
||||
|
||||
public class WebViewActivity extends AppCompatActivity {
|
||||
|
||||
private String url;
|
||||
@@ -156,6 +156,33 @@ public class WebViewActivity extends AppCompatActivity {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// @TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
||||
LogUtils.i("数据接口:onShowFileChooser");
|
||||
mUploadCallbackForHighApi = filePathCallback;
|
||||
Intent intent = fileChooserParams.createIntent();
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER);
|
||||
return true;
|
||||
}
|
||||
|
||||
// For 3.0+
|
||||
protected void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
|
||||
LogUtils.i("数据接口:openFileChooseracceptType");
|
||||
openFilerChooser(uploadMsg);
|
||||
}
|
||||
|
||||
|
||||
private void openFilerChooser(ValueCallback<Uri> uploadMsg) {
|
||||
LogUtils.i("数据接口:openFileChooser");
|
||||
mUploadCallbackForLowApi = uploadMsg;
|
||||
startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER);
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
|
||||
@@ -329,6 +356,53 @@ public class WebViewActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
switch (requestCode) {
|
||||
case REQUEST_CODE_FILE_CHOOSER:
|
||||
if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) {
|
||||
afterFileChooseGoing(resultCode, data);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* onActivityResult方法
|
||||
*/
|
||||
|
||||
private void afterFileChooseGoing(int resultCode, Intent data) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (mUploadCallbackForHighApi == null) {
|
||||
return;
|
||||
}
|
||||
mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data));
|
||||
mUploadCallbackForHighApi = null;
|
||||
} else {
|
||||
if (mUploadCallbackForLowApi == null) {
|
||||
return;
|
||||
}
|
||||
Uri result = data == null ? null : data.getData();
|
||||
mUploadCallbackForLowApi.onReceiveValue(result);
|
||||
mUploadCallbackForLowApi = null;
|
||||
}
|
||||
}
|
||||
|
||||
private Intent getFilerChooserIntent() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
return intent;
|
||||
}
|
||||
|
||||
|
||||
private static final int REQUEST_CODE_FILE_CHOOSER = 1;
|
||||
private ValueCallback<Uri> mUploadCallbackForLowApi;
|
||||
private boolean isNetError = false;
|
||||
|
||||
public void onShowErrorView(String errorMsg) { //网络不可用的情况
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
android:id="@+id/iv_notifyimage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">TestApp</string>
|
||||
<string name="qsrlwmm_txt">Please Set Your Password</string>
|
||||
<string name="cancel_txt">Cancel</string>
|
||||
<string name="sure_txt">Sure</string>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">TestApp</string>
|
||||
<string name="qsrlwmm_txt">请输入6位密码</string>
|
||||
<string name="cancel_txt">取消</string>
|
||||
<string name="sure_txt">确定</string>
|
||||
|
||||
Reference in New Issue
Block a user