liuyuqi-dellpc 3 years ago
parent
commit
71fa17976d

+ 7 - 0
README.md

@@ -0,0 +1,7 @@
+## open2share
+
+android 文件打开方式转为分享。(微信打开文件选择本app可以转为分享事件)
+
+
+
+

+ 0 - 1
app/build.gradle

@@ -25,7 +25,6 @@ dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
     implementation 'androidx.appcompat:appcompat:1.2.0'
     implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
-    implementation 'androidx.preference:preference:1.2.0'
 
     testImplementation 'junit:junit:4.12'
     androidTestImplementation 'androidx.test.ext:junit:1.1.2'

+ 1 - 3
app/src/main/AndroidManifest.xml

@@ -17,10 +17,8 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:name=".views.SettingActivity"/>
         <activity android:name=".views.ReceiveActivity"
-            android:excludeFromRecents="true"
-            >
+            android:excludeFromRecents="true">
         <intent-filter
             android:label="open to share"
             tools:ignore="AppLinkUrlError">

+ 9 - 2
app/src/main/java/me/yoqi/android/open2share/MainActivity.java

@@ -1,15 +1,22 @@
 package me.yoqi.android.open2share;
 
 import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.Fragment;
 
+import android.content.ComponentName;
+import android.content.pm.PackageManager;
 import android.os.Bundle;
 
+import java.util.Objects;
+
+/**
+ * 设置界面
+ */
 public class MainActivity extends AppCompatActivity {
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_main);
+        setContentView(R.layout.activity_setting);
     }
-
 }

+ 0 - 20
app/src/main/java/me/yoqi/android/open2share/views/SettingActivity.java

@@ -1,20 +0,0 @@
-package me.yoqi.android.open2share.views;
-
-import android.os.Bundle;
-
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-
-import me.yoqi.android.open2share.R;
-
-/** 设置界面
- * @author liuyuqi.gov@msn.cn
- * @createTime 2020-09-28
- */
-public class SettingActivity extends AppCompatActivity {
-    @Override
-    protected void onCreate(@Nullable Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_setting);
-    }
-}

+ 0 - 18
app/src/main/res/layout/activity_main.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context=".MainActivity">
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Hello World!"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>

+ 15 - 4
app/src/main/res/layout/activity_setting.xml

@@ -1,9 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/ll_main"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
-    <FrameLayout
-        android:id="@+id/settings"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <Button
+        android:layout_marginTop="50dp"
+        android:id="@+id/btn_a"
         android:layout_width="match_parent"
-        android:layout_height="match_parent" />
+        android:layout_height="wrap_content"
+        android:text="12" />
+
+    <Button
+        android:id="@+id/btn_b"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="22" />
 </LinearLayout>