Commit 5aefaf80 by amateur

1

1 parent 9ef3152e
......@@ -18,7 +18,10 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!-- 微信软件可见性适配方案-->
<queries>
<package android:name="com.tencent.mm" />
</queries>
<application
android:name=".MyApplication"
android:allowBackup="false"
......
package com.polysoft.nafmii.fragment.dialog;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.MimeTypeMap;
import android.widget.TextView;
import androidx.annotation.NonNull;
......@@ -15,6 +18,7 @@ import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import com.polysoft.nafmii.net.OkhttpApi;
import com.polysoft.nafmii.utils.FileProviderUtils;
import com.polysoft.nafmii.utils.FileUtils;
import com.polysoft.nafmii.utils.ToastUtils;
import com.whaty.nafmii.R;
......@@ -75,7 +79,8 @@ public class DownloadDialog extends DialogFragment {
String downloadName = FileUtils.getSysDownLoadDir().getName();
String tipsPath = new File(downloadName, name).getAbsolutePath();
mProgressText.post(() -> {
ToastUtils.showLong("下载完成 " + tipsPath);
ToastUtils.showLong("下载目录 " + tipsPath);
openFile(file);
dismiss();
});
return;
......@@ -94,4 +99,13 @@ public class DownloadDialog extends DialogFragment {
}
private void openFile(File file) {
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri fileUri = FileProviderUtils.getUriForFile(getContext(), file);
String extension = MimeTypeMap.getFileExtensionFromUrl(fileUri.toString());
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
intent.setDataAndType(fileUri, mimeType);
getActivity().startActivity(intent);
}
}
......@@ -34,7 +34,7 @@
android:layout_height="wrap_content"
android:text="跳过"
android:textColor="@color/white"
android:textSize="18sp" />
android:textSize="18dp" />
<TextView
android:id="@+id/advertisement_countdown"
......@@ -43,7 +43,7 @@
android:layout_marginLeft="5dp"
android:text="5s"
android:textColor="@color/white"
android:textSize="18sp" />
android:textSize="18dp" />
</LinearLayout>
......
......@@ -9,7 +9,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/dialog_bg_white_round"
android:orientation="vertical"
android:padding="15dp"
......@@ -31,89 +31,108 @@
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text1"
android:textColor="#666"
android:textSize="14sp" />
<TextView
android:id="@+id/privacy_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text2"
android:textColor="#666"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text3"
android:textColor="#666"
android:textSize="14sp" />
<TextView
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text4"
android:textColor="#666"
android:textSize="14sp" />
android:layout_weight="1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text5"
android:textColor="#666"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text6"
android:textColor="#666"
android:textSize="14sp" />
<CheckBox
android:id="@+id/privacy_checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:text="查看并同意《隐私政策》及《服务协议》"
android:textColor="#999"
android:textSize="13sp"
android:theme="@style/Theme.AppCompat.Light" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text1"
android:textColor="#666"
android:textSize="14sp" />
<TextView
android:id="@+id/privacy_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text2"
android:textColor="#666"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text3"
android:textColor="#666"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text4"
android:textColor="#666"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text5"
android:textColor="#666"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_dialog_text6"
android:textColor="#666"
android:textSize="14sp" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="vertical"
tools:ignore="MissingConstraints">
<TextView
android:id="@+id/privacy_btn_cancel"
<CheckBox
android:id="@+id/privacy_checkbox"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:background="@drawable/dialog_privacy_btn_round"
android:gravity="center"
android:text="不同意"
android:textColor="#999" />
<TextView
android:id="@+id/privacy_btn_ok"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:text="查看并同意《隐私政策》及《服务协议》"
android:textColor="#999"
android:textSize="13sp"
android:theme="@style/Theme.AppCompat.Light" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/dialog_privacy_btn_round2"
android:gravity="center"
android:text="同意并继续"
android:textColor="@color/white" />
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/privacy_btn_cancel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:background="@drawable/dialog_privacy_btn_round"
android:gravity="center"
android:text="不同意"
android:textColor="#999" />
<TextView
android:id="@+id/privacy_btn_ok"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/dialog_privacy_btn_round2"
android:gravity="center"
android:text="同意并继续"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
......
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Nafmii.Widget.Home.RadioButton" parent="">
<item name="android:textSize">12sp</item>
<item name="android:textSize">12dp</item>
<item name="android:layout_weight">1</item>
<item name="android:button">@null</item>
<item name="android:gravity">center|bottom</item>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!