From 2920d17894cdceea05ee2799babc9b3ed253091f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9B=A8=E8=BD=A9?= Date: Thu, 24 Nov 2022 21:53:28 +0800 Subject: [PATCH] About Comment --- src/Comment/.gitignore | 15 + src/Comment/.idea/.gitignore | 3 + src/Comment/.idea/.name | 1 + src/Comment/.idea/compiler.xml | 6 + src/Comment/.idea/dbnavigator.xml | 463 ++++++++++++++++++ src/Comment/.idea/gradle.xml | 20 + src/Comment/.idea/misc.xml | 10 + src/Comment/app/.gitignore | 1 + src/Comment/app/build.gradle | 44 ++ src/Comment/app/proguard-rules.pro | 21 + .../ExampleInstrumentedTest.java | 26 + src/Comment/app/src/main/AndroidManifest.xml | 32 ++ .../example/myapplication/AdapterComment.java | 80 +++ .../com/example/myapplication/Comment.java | 33 ++ .../example/myapplication/FirstFragment.java | 47 ++ .../example/myapplication/MainActivity.java | 121 +++++ .../example/myapplication/SecondFragment.java | 47 ++ .../drawable-v24/ic_launcher_foreground.xml | 30 ++ .../app/src/main/res/drawable/chat.png | Bin 0 -> 5405 bytes .../app/src/main/res/drawable/comment.png | Bin 0 -> 1994 bytes .../app/src/main/res/drawable/hide_dowm.png | Bin 0 -> 351 bytes .../res/drawable/ic_launcher_background.xml | 170 +++++++ .../app/src/main/res/layout/activity_main.xml | 94 ++++ .../app/src/main/res/layout/content_main.xml | 19 + .../src/main/res/layout/fragment_first.xml | 28 ++ .../src/main/res/layout/fragment_second.xml | 27 + .../app/src/main/res/layout/item_comment.xml | 23 + .../app/src/main/res/menu/menu_main.xml | 10 + .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes .../app/src/main/res/navigation/nav_graph.xml | 28 ++ .../app/src/main/res/values-land/dimens.xml | 3 + .../app/src/main/res/values-night/themes.xml | 16 + .../src/main/res/values-w1240dp/dimens.xml | 3 + .../app/src/main/res/values-w600dp/dimens.xml | 3 + .../app/src/main/res/values/colors.xml | 16 + .../app/src/main/res/values/dimens.xml | 3 + .../app/src/main/res/values/strings.xml | 16 + .../app/src/main/res/values/themes.xml | 25 + .../app/src/main/res/xml/backup_rules.xml | 13 + .../main/res/xml/data_extraction_rules.xml | 19 + .../myapplication/ExampleUnitTest.java | 17 + src/Comment/build.gradle | 5 + src/Comment/gradle.properties | 21 + src/Comment/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + src/Comment/gradlew | 185 +++++++ src/Comment/gradlew.bat | 89 ++++ src/Comment/settings.gradle | 16 + 59 files changed, 1865 insertions(+) create mode 100644 src/Comment/.gitignore create mode 100644 src/Comment/.idea/.gitignore create mode 100644 src/Comment/.idea/.name create mode 100644 src/Comment/.idea/compiler.xml create mode 100644 src/Comment/.idea/dbnavigator.xml create mode 100644 src/Comment/.idea/gradle.xml create mode 100644 src/Comment/.idea/misc.xml create mode 100644 src/Comment/app/.gitignore create mode 100644 src/Comment/app/build.gradle create mode 100644 src/Comment/app/proguard-rules.pro create mode 100644 src/Comment/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java create mode 100644 src/Comment/app/src/main/AndroidManifest.xml create mode 100644 src/Comment/app/src/main/java/com/example/myapplication/AdapterComment.java create mode 100644 src/Comment/app/src/main/java/com/example/myapplication/Comment.java create mode 100644 src/Comment/app/src/main/java/com/example/myapplication/FirstFragment.java create mode 100644 src/Comment/app/src/main/java/com/example/myapplication/MainActivity.java create mode 100644 src/Comment/app/src/main/java/com/example/myapplication/SecondFragment.java create mode 100644 src/Comment/app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 src/Comment/app/src/main/res/drawable/chat.png create mode 100644 src/Comment/app/src/main/res/drawable/comment.png create mode 100644 src/Comment/app/src/main/res/drawable/hide_dowm.png create mode 100644 src/Comment/app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 src/Comment/app/src/main/res/layout/activity_main.xml create mode 100644 src/Comment/app/src/main/res/layout/content_main.xml create mode 100644 src/Comment/app/src/main/res/layout/fragment_first.xml create mode 100644 src/Comment/app/src/main/res/layout/fragment_second.xml create mode 100644 src/Comment/app/src/main/res/layout/item_comment.xml create mode 100644 src/Comment/app/src/main/res/menu/menu_main.xml create mode 100644 src/Comment/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 src/Comment/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 src/Comment/app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 src/Comment/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 src/Comment/app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 src/Comment/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 src/Comment/app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 src/Comment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 src/Comment/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 src/Comment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 src/Comment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 src/Comment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 src/Comment/app/src/main/res/navigation/nav_graph.xml create mode 100644 src/Comment/app/src/main/res/values-land/dimens.xml create mode 100644 src/Comment/app/src/main/res/values-night/themes.xml create mode 100644 src/Comment/app/src/main/res/values-w1240dp/dimens.xml create mode 100644 src/Comment/app/src/main/res/values-w600dp/dimens.xml create mode 100644 src/Comment/app/src/main/res/values/colors.xml create mode 100644 src/Comment/app/src/main/res/values/dimens.xml create mode 100644 src/Comment/app/src/main/res/values/strings.xml create mode 100644 src/Comment/app/src/main/res/values/themes.xml create mode 100644 src/Comment/app/src/main/res/xml/backup_rules.xml create mode 100644 src/Comment/app/src/main/res/xml/data_extraction_rules.xml create mode 100644 src/Comment/app/src/test/java/com/example/myapplication/ExampleUnitTest.java create mode 100644 src/Comment/build.gradle create mode 100644 src/Comment/gradle.properties create mode 100644 src/Comment/gradle/wrapper/gradle-wrapper.jar create mode 100644 src/Comment/gradle/wrapper/gradle-wrapper.properties create mode 100644 src/Comment/gradlew create mode 100644 src/Comment/gradlew.bat create mode 100644 src/Comment/settings.gradle diff --git a/src/Comment/.gitignore b/src/Comment/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/src/Comment/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/src/Comment/.idea/.gitignore b/src/Comment/.idea/.gitignore new file mode 100644 index 0000000..eaf91e2 --- /dev/null +++ b/src/Comment/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/src/Comment/.idea/.name b/src/Comment/.idea/.name new file mode 100644 index 0000000..b3405b3 --- /dev/null +++ b/src/Comment/.idea/.name @@ -0,0 +1 @@ +My Application \ No newline at end of file diff --git a/src/Comment/.idea/compiler.xml b/src/Comment/.idea/compiler.xml new file mode 100644 index 0000000..7d7ec2e --- /dev/null +++ b/src/Comment/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/Comment/.idea/dbnavigator.xml b/src/Comment/.idea/dbnavigator.xml new file mode 100644 index 0000000..309eda1 --- /dev/null +++ b/src/Comment/.idea/dbnavigator.xml @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Comment/.idea/gradle.xml b/src/Comment/.idea/gradle.xml new file mode 100644 index 0000000..64d29a1 --- /dev/null +++ b/src/Comment/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/src/Comment/.idea/misc.xml b/src/Comment/.idea/misc.xml new file mode 100644 index 0000000..7063837 --- /dev/null +++ b/src/Comment/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/Comment/app/.gitignore b/src/Comment/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/src/Comment/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/src/Comment/app/build.gradle b/src/Comment/app/build.gradle new file mode 100644 index 0000000..3863ce2 --- /dev/null +++ b/src/Comment/app/build.gradle @@ -0,0 +1,44 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.myapplication' + compileSdk 33 + + defaultConfig { + applicationId "com.example.myapplication" + minSdk 17 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildFeatures { + viewBinding true + } +} + +dependencies { +// implementation 'org.litepal.android:core:3.2.3' + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'androidx.navigation:navigation-fragment:2.4.1' + implementation 'androidx.navigation:navigation-ui:2.4.1' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/src/Comment/app/proguard-rules.pro b/src/Comment/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/src/Comment/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/src/Comment/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java b/src/Comment/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java new file mode 100644 index 0000000..982ba51 --- /dev/null +++ b/src/Comment/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.myapplication; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.myapplication", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/src/Comment/app/src/main/AndroidManifest.xml b/src/Comment/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4075db8 --- /dev/null +++ b/src/Comment/app/src/main/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Comment/app/src/main/java/com/example/myapplication/AdapterComment.java b/src/Comment/app/src/main/java/com/example/myapplication/AdapterComment.java new file mode 100644 index 0000000..8bf6feb --- /dev/null +++ b/src/Comment/app/src/main/java/com/example/myapplication/AdapterComment.java @@ -0,0 +1,80 @@ +package com.example.myapplication; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.TextView; + +import com.example.myapplication.R; +import com.example.myapplication.Comment; + +import java.util.List; + +/** + * Created by yyp on 2016/8/10. + */ +public class AdapterComment extends BaseAdapter { + + Context context; + List data; + + public AdapterComment(Context c, List data){ + this.context = c; + this.data = data; + } + + @Override + public int getCount() { + return data.size(); + } + + @Override + public Object getItem(int i) { + return data.get(i); + } + + @Override + public long getItemId(int i) { + return i; + } + + @Override + public View getView(int i, View convertView, ViewGroup viewGroup) { + ViewHolder holder; + // 重用convertView + if(convertView == null){ + holder = new ViewHolder(); + convertView = LayoutInflater.from(context).inflate(R.layout.item_comment, null); + holder.comment_name = (TextView) convertView.findViewById(R.id.comment_name); + holder.comment_content = (TextView) convertView.findViewById(R.id.comment_content); + + convertView.setTag(holder); + }else{ + holder = (ViewHolder) convertView.getTag(); + } + // 适配数据 + holder.comment_name.setText(data.get(i).getName()); + holder.comment_content.setText(data.get(i).getContent()); + + return convertView; + } + + /** + * 添加一条评论,刷新列表 + * @param comment + */ + public void addComment(Comment comment){ + data.add(comment); + notifyDataSetChanged(); + } + + /** + * 静态类,便于GC回收 + */ + public static class ViewHolder{ + TextView comment_name; + TextView comment_content; + } +} diff --git a/src/Comment/app/src/main/java/com/example/myapplication/Comment.java b/src/Comment/app/src/main/java/com/example/myapplication/Comment.java new file mode 100644 index 0000000..1214c00 --- /dev/null +++ b/src/Comment/app/src/main/java/com/example/myapplication/Comment.java @@ -0,0 +1,33 @@ +package com.example.myapplication; + + +public class Comment { + + String name; //评论者 + String content; //评论内容 + + public Comment(){ + + } + + public Comment(String name, String content){ + this.name = name; + this.content = content; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } +} \ No newline at end of file diff --git a/src/Comment/app/src/main/java/com/example/myapplication/FirstFragment.java b/src/Comment/app/src/main/java/com/example/myapplication/FirstFragment.java new file mode 100644 index 0000000..3c16010 --- /dev/null +++ b/src/Comment/app/src/main/java/com/example/myapplication/FirstFragment.java @@ -0,0 +1,47 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import androidx.navigation.fragment.NavHostFragment; + +import com.example.myapplication.databinding.FragmentFirstBinding; + +public class FirstFragment extends Fragment { + + private FragmentFirstBinding binding; + + @Override + public View onCreateView( + LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState + ) { + + binding = FragmentFirstBinding.inflate(inflater, container, false); + return binding.getRoot(); + + } + + public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + binding.buttonFirst.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + NavHostFragment.findNavController(FirstFragment.this) + .navigate(R.id.action_FirstFragment_to_SecondFragment); + } + }); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + binding = null; + } + +} \ No newline at end of file diff --git a/src/Comment/app/src/main/java/com/example/myapplication/MainActivity.java b/src/Comment/app/src/main/java/com/example/myapplication/MainActivity.java new file mode 100644 index 0000000..dc4d6b6 --- /dev/null +++ b/src/Comment/app/src/main/java/com/example/myapplication/MainActivity.java @@ -0,0 +1,121 @@ +package com.example.myapplication; + +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.view.View; +import android.view.inputmethod.InputMethodManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import com.example.myapplication.AdapterComment; +import com.example.myapplication.Comment; + +import java.util.ArrayList; +import java.util.List; + +public class MainActivity extends Activity implements View.OnClickListener { + + private ImageView comment; + private TextView hide_down; + private EditText comment_content; + private Button comment_send; + + private LinearLayout rl_enroll; + private RelativeLayout rl_comment; + + private ListView comment_list; + private AdapterComment adapterComment; + private List data; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + initView(); + } + + private void initView() { + + // 初始化评论列表 + comment_list = (ListView) findViewById(R.id.comment_list); + // 初始化数据 + data = new ArrayList<>(); + // 初始化适配器 + adapterComment = new AdapterComment(getApplicationContext(), data); + // 为评论列表设置适配器 + comment_list.setAdapter(adapterComment); + + comment = (ImageView) findViewById(R.id.comment); + hide_down = (TextView) findViewById(R.id.hide_down); + comment_content = (EditText) findViewById(R.id.comment_content); + comment_send = (Button) findViewById(R.id.comment_send); + + rl_enroll = (LinearLayout) findViewById(R.id.rl_enroll); + rl_comment = (RelativeLayout) findViewById(R.id.rl_comment); + + setListener(); + } + + /** + * 设置监听 + */ + public void setListener(){ + comment.setOnClickListener(this); + + hide_down.setOnClickListener(this); + comment_send.setOnClickListener(this); + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.comment: + // 弹出输入法 + InputMethodManager imm = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE); + imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); + // 显示评论框 + rl_enroll.setVisibility(View.GONE); + rl_comment.setVisibility(View.VISIBLE); + break; + case R.id.hide_down: + // 隐藏评论框 + rl_enroll.setVisibility(View.VISIBLE); + rl_comment.setVisibility(View.GONE); + // 隐藏输入法,然后暂存当前输入框的内容,方便下次使用 + InputMethodManager im = (InputMethodManager)getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE); + im.hideSoftInputFromWindow(comment_content.getWindowToken(), 0); + break; + case R.id.comment_send: + sendComment(); + break; + default: + break; + } + } + + /** + * 发送评论 + */ + public void sendComment(){ + if(comment_content.getText().toString().equals("")){ + Toast.makeText(getApplicationContext(), "评论不能为空!", Toast.LENGTH_SHORT).show(); + }else{ + // 生成评论数据 + Comment comment = new Comment(); + comment.setName("评论者"+(data.size()+1)+":"); + comment.setContent(comment_content.getText().toString()); + adapterComment.addComment(comment); + // 发送完,清空输入框 + comment_content.setText(""); + + Toast.makeText(getApplicationContext(), "评论成功!", Toast.LENGTH_SHORT).show(); + } + } +} diff --git a/src/Comment/app/src/main/java/com/example/myapplication/SecondFragment.java b/src/Comment/app/src/main/java/com/example/myapplication/SecondFragment.java new file mode 100644 index 0000000..3d37bd9 --- /dev/null +++ b/src/Comment/app/src/main/java/com/example/myapplication/SecondFragment.java @@ -0,0 +1,47 @@ +package com.example.myapplication; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import androidx.navigation.fragment.NavHostFragment; + +import com.example.myapplication.databinding.FragmentSecondBinding; + +public class SecondFragment extends Fragment { + + private FragmentSecondBinding binding; + + @Override + public View onCreateView( + LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState + ) { + + binding = FragmentSecondBinding.inflate(inflater, container, false); + return binding.getRoot(); + + } + + public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + binding.buttonSecond.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + NavHostFragment.findNavController(SecondFragment.this) + .navigate(R.id.action_SecondFragment_to_FirstFragment); + } + }); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + binding = null; + } + +} \ No newline at end of file diff --git a/src/Comment/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/src/Comment/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/src/Comment/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Comment/app/src/main/res/drawable/chat.png b/src/Comment/app/src/main/res/drawable/chat.png new file mode 100644 index 0000000000000000000000000000000000000000..84b5101dc4c4470bcb9531cfea26d658bc81ef3b GIT binary patch literal 5405 zcmV+&72@iNP)-z`qKTsLWE5*O&k{ApnAj$X zNk*NRd1+&2Mx#kI&fCkgogs#H_Br&vI+p0fY5*Is=gBsrvp*&1^I=48xM zFfYQq1M?L*MWs6?p8nrPRW&{-I(GAUSL~Kn_&`BL^)CMZuVdbec^T$X%;}gzFxz9+ z!Yqpf>NgsK*#vVq0r?HghYajp@8z|ee^z|#=D+#og7z!Vy^AXz;QO4$T#LC3a{^{t z%t`_zq9fR8`j{igZhp(a!R=ODP4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HlII-o9#I*hoK>3pg@4`OAHiT}tB{yhV)YEF zf>;o_ajq%j&j=v0XNQ>d+lWbqH5{z&Z&?z!sPr6PdPe}YFHM?u{yf|}aRJY8*BorjwT3Ow-4`dGs4;0iO8d=MnKP^}UQF9(=sZp-!$5F|~3!NFd1u-@mmLJPWq1paWZ zz?TD%!IXro8dDOIh20r|n1PVth$$b7MojrKgn@$*GeryP3Z02tT3?z?u|WmCxnCG~ z$%M8r(gwa|U}Q7mp)gUPK?c56Nc4Hclz$0j;L-%X-Pokt#DStDETx zGfN<80zb53RlRV|OCk6HGZul9Mdo|iK4 zL+7rB0Ln@vp*d~>_}vw4?mGE&^n|i@#3VupBu(I_Hnc%WmeA5wf~a`hj^n*HB1)-m z`w}s6a-o~I1W{AtB}let&fIbA@hbxxpx+F1pKukHNU|wDfB$>` zQTmFG-gu6f4pYL8mjVJ8?L55O9~B+D3BW^zs-v(hqNo1{uYTgxEn0if00000NkvXX Hu0mjfEhl#T literal 0 HcmV?d00001 diff --git a/src/Comment/app/src/main/res/drawable/comment.png b/src/Comment/app/src/main/res/drawable/comment.png new file mode 100644 index 0000000000000000000000000000000000000000..fb0a35aace4b41ea43cd30050026d9678c41b36b GIT binary patch literal 1994 zcmb7Fdpy$%8y~|$8D%7|hR{Jb=2E%6q>Gf5TpBf(m@>U9(uUa#Nm5>?&}D~1hg_%T zQclB=EyCm)!ghoj*$*v0Hg?vZ=l$>f*am^XvOU~geMqC<#^X+D`$M?bNB_7IFji`w;bU|~b~!W<9a;Lz ziSpoVd`r>5T?31cPwb4JyM<_DG|V#$4H?m$-ORhu0f9aiT*Z6Jwba`7z(}7_v(szG zWiJRiFG^9+E^HSlF8cx(wc+wauxNnF#lS&1^gx|(pwwZEEKX%T-qy0A+5baT3c$p@X=sa@x5 zTpY6dZa8iJkC1BfWAwbVs_z_TRYxUBDG+GSf6QnD;Q49DMrTtfd;N@fY&&G@d#h7g zu4N9?*<|D!#n-qiQG53641pWw(A^NUK+ApDEs^up+8<^^nr za!C=LyXM+-QMx+}QW>HLsW9GF=BwqQWw~O~{dQdY?2k7^RYL|QfUQBw)Nhlkeh`zx zq+2-&krYP^Q{<&YnOEcI{+gv=IFx&|H|B<1_8=MA81@*^jz=^M6@ek^7Gv0v59GnG zaj&J(w(5TFCD)v>u@fC^T@GwhDtzDud`-8&m-IQmUR#;c+fXp6wUm zH)DmMHk4X>vLTcxO{nxttZf}#)};Bze$r7Bx$+HGa9vxc7yQb>u;t>Xix+^fsTDIQ z(oi#>#hqL{XdFr^`wPYE7OH`8_!=-0$s4HLM!A3+SAFGo|~& znQ1_q^xL~Rzx*r9{C#89@%X4MXU#QStu5mcJs#X zAPVM%BFT&<_{&XDP>e-_8snM7Oy{VpMuTtD(Ku-$jx#1I(q*on@+wrdv&M1!)l-Kr z6He^JW`bRrL1;VT{Wse4fR(BpHoncj-I@nAkqMNo1n-aM#&fS}fW5T>z3Ry3eNkn| zG-Bb1;MGHF^NHL^YbaQf=8pnwKgnC;Th0l4=Kj<}M=)C@IkkIAA`?!Q_K$ng2r6Js z;o{wog8nG-eLs%sE%*gK+T<<|a|gI_f*L)r9^Z;1!!SbM zmvmrIH}@UyJAH>bTxyP*s!(ow?;FOMJ%C>Do_X20Q7^1FrPc9Tq0|f(7v`g$8j-v9 zF9eMjd~5PN<$4(%x)a2ut(d-vPUMF>0)aPx@#ppS-#1#sJJ|NySef&kP#*(mYhFBs zH15rV!pSk+Bqx5yAxhH7Aga2Ja-UGAPvAgkegnhGfn5k-1D82a>9Ie$?&CVsS7M+Y{-_ac8Top|Iy;#IzW97iHl zK;IOzP!r8-uoi$lylh-Ln^|9hgi+=$ffGiBlP-X`VTVNhprGT>g@a^n5}|$(=LpVleZ)$k~u5S5`1;IZp*6p&C;ttr67O;V literal 0 HcmV?d00001 diff --git a/src/Comment/app/src/main/res/drawable/hide_dowm.png b/src/Comment/app/src/main/res/drawable/hide_dowm.png new file mode 100644 index 0000000000000000000000000000000000000000..a2861a9e93a365c2aa9cc05f89c87a8963982c28 GIT binary patch literal 351 zcmeAS@N?(olHy`uVBq!ia0vp^{2gx8%hH$8# zIC--0)alc&{XIPcS-2TYpNEBn{9*U9IdkH~23GDQ#+NT&@;P|VYq-L6voPV{jT;dU z*Q{Bisj8~_zj2%Wxie=<7`+u37c6||uygs+rAz-eW~m=Jew^E3sf2`+laoc`tSSdK z5fKp^KVRRkEnbEUM{67XYQth;{>Y!m`~KlWLc5ouLq>*%^abu*S6A2njpwR)Q+_iQ z3QYJbwrbwIWy1b_jHWg08yo%BGI$v~h6pk^_^K-SD$JQX sH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Comment/app/src/main/res/layout/activity_main.xml b/src/Comment/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..c9838d0 --- /dev/null +++ b/src/Comment/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + +