Compare commits

...

2 Commits

Author SHA1 Message Date
heaum-yu 6ce29abc5e PS
3 years ago
heaum-yu 5c3e7b8bd3 PS
3 years ago

15
.gitignore vendored

@ -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

3
.idea/.gitignore vendored

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1 @@
Picture-Sharing

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
</component>
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/drawable/roundbutton.xml" value="0.1665" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/activity_create_my_photo.xml" value="0.25364583333333335" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/activity_login.xml" value="0.15364583333333334" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/activity_main.xml" value="0.15364583333333334" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/activity_register.xml" value="0.15364583333333334" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/app_bar_main.xml" value="0.15364583333333334" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/avtivity_home_item_click_layout.xml" value="0.15364583333333334" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/content_main.xml" value="0.18854166666666666" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/fragment_collect.xml" value="0.18854166666666666" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/fragment_gallery.xml" value="0.15364583333333334" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/fragment_home.xml" value="0.1125" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/fragment_personal.xml" value="0.25364583333333335" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/nav_header_main.xml" value="0.18854166666666666" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/recycleview_home_item.xml" value="0.18854166666666666" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/recycleview_home_item_comments.xml" value="0.18854166666666666" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/recycleview_mine_item.xml" value="0.18854166666666666" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/layout/recycleview_person_item.xml" value="0.18854166666666666" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/menu/activity_main_drawer.xml" value="0.15364583333333334" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/menu/main.xml" value="0.18854166666666666" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.1665" />
<entry key="..\:/Users/12150/Desktop/2/PictureSharing/PictureSharing/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.1665" />
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -0,0 +1 @@
Subproject commit 74e9b1e4f9cdbe87c091c88ca3366d755c93b13a

1
app/.gitignore vendored

@ -0,0 +1 @@
/build

@ -0,0 +1,58 @@
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.picture_sharing"
minSdk 21
targetSdk 32
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 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation files('libs/SQLiteStudioRemote.jar')
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.facebook.fresco:fresco:0.14.1'
implementation 'io.github.bmob:android-sdk:3.8.8'
implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.google.code.gson:gson:2.8.5'
}

Binary file not shown.

@ -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

@ -0,0 +1,26 @@
package com.example.picture_sharing;
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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.picture_sharing", appContext.getPackageName());
}
}

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.picture_sharing">
<!--允许联网 -->
<uses-permission android:name="android.permission.INTERNET" />
<!--获取GSM2g、WCDMA联通3g等网络状态的信息 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--获取wifi网络状态的信息 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!--保持CPU 运转,屏幕和键盘灯有可能是关闭的,用于文件上传和下载 -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!--获取sd卡写的权限用于文件上传和下载-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--允许读取手机状态 用于创建BmobInstallation-->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 获取读取照片权限 -->
<application
android:networkSecurityConfig="@xml/network_security_config"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.PictureSharing">
<provider
android:name="cn.bmob.v3.util.BmobContentProvider"
android:authorities="com.example.picture_sharing.BmobContentProvider">
</provider>
<activity android:name=".Register.RegisterActivity"></activity>
<activity android:name=".Home_ItemActivity"></activity>
<activity
android:name=".publish.CreateMyPhotoActivity"
android:label="完善分享信息"
android:screenOrientation="portrait" />
<activity
android:name=".Login.LoginActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.PictureSharing.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"></activity>
</application>
</manifest>

@ -0,0 +1,440 @@
package com.example.picture_sharing;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.example.picture_sharing.Login.LoginActivity;
import com.example.picture_sharing.publish.CommentAdapter;
import com.example.picture_sharing.publish.Mycomment;
import com.example.picture_sharing.publish.Mydynamic;
import com.example.picture_sharing.Person_RecycleView.MyCollection;
import com.example.picture_sharing.SQL.Iscollect;
import com.example.picture_sharing.SQL.Share;
import com.google.gson.Gson;
import org.json.JSONObject;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class Home_ItemActivity extends AppCompatActivity implements View.OnClickListener {
public static ImageView igdetail;
public TextView tv_item_title;
public TextView tv_item_detail;
public TextView tv_item_count;
public EditText et_mcomment;
public ImageView ig_collect;
public ImageView igBack;
public Button bt_comment;
public String iscollect1;
public String ObjectId;
public String sharerId;
public String sharerName;
public static String itemUri;
public int itemId;
public String itemtitle;
public String itemdetail;
public int itemHeight;
public Uri hhuri;
public static boolean flag = true;
public int j=0;
public static String collectid;
public String imgid;
public static List<Mycomment.sdata.pcomment> commentList;
public static List<Mycomment> ALLcommentList;
public List<Mydynamic> mlist;
protected static String sharename;
public MyCollection myCollection;
public RecyclerView CRecyclerview;
public RecyclerView.LayoutManager ClayoutManager;
public CommentAdapter commentAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.avtivity_home_item_click_layout);
initview();
getitemmessage();
showcollect();//显示是否收藏
getcomment(); //获取评论
// this.getSupportActionBar().hide();//隐藏标题栏
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.img_back_home:
finish();
break;
case R.id.Comment:
/**************************获取评论信息储存在Mycomment类中***************************/
// String mcomment = et_mcomment.getText().toString();
// if (!TextUtils.isEmpty(mcomment)) {
if(true){
// Mycomment c = new Mycomment
// (itemId,
// Integer.valueOf(MainActivity.UserId),
// MainActivity.mname,
// mcomment,
// MainActivity.myh);
// c.save(new SaveListener<String>() {
// @Override
// public void done(String s, BmobException e) {
//
// }
// });
// getcomment();
putcomment();
/************************************************************************************/
et_mcomment.setText("");//评论完成后重置输入框
/*********************************显示评论***********************************/
// commentList.add(c);
// commentAdapter = new CommentAdapter(Home_ItemActivity.this, commentList);
// CRecyclerview.setAdapter(commentAdapter);
// j++;
// tv_item_count.setText("共有" + j + "条评论");
/*********************************************************************/
getcomment(); //重新获取评论
} else Toast.makeText(Home_ItemActivity.this, "评论不能为空!", Toast.LENGTH_SHORT).show();
break;
case R.id.ig_home_item_collect:
if (flag) {//取消收藏
ig_collect.setImageResource(R.drawable.shouchang);
collect_delete();
} else {//收藏
ig_collect.setImageResource(R.drawable.dynamic_is_selected);
collect_chose();
break;
}
}
}
private void getcomment(){
String url1 = "http://47.107.52.7:88/member/photo/comment/first?current=0&shareId="+sharerId+"&size=10"; //chuangzhi
// url = url+"?current="+"0"+"&size="+"10"+"&userId="+"1532321653437108224";
Log.d("shareid",sharerId);
OkHttpClient okHttpClient = new OkHttpClient();
final Request request = new Request.Builder()
.url(url1)
.addHeader("appId", MainActivity.appId)
.addHeader("appSecret", MainActivity.appSecret)
.get()
.build();
Call call = okHttpClient.newCall(request);
List<Share.data.record> records111 = null;
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d("11111111", "onfailure");
// List<Share.data.record> records111 = null;
// return records111;
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
if (true) {
String b = response.body().string();
Log.d("12312313",b);
runOnUiThread(new Runnable() {
@Override
public void run() {
Gson gson = new Gson();
Mycomment json = gson.fromJson(b,Mycomment.class);
// Log.d("2131321",json.toString());
List<Mycomment.sdata.pcomment> pcomments = json.getData().getRecords();
// Log.d("2131321",pcomments.get(0).getContent());
commentList = pcomments;
commentAdapter = new CommentAdapter(Home_ItemActivity.this, commentList);
CRecyclerview.setAdapter(commentAdapter);
j = Integer.valueOf(json.getData().getTotal());
tv_item_count.setText("共有"+j+"条评论");
}
});
}
}
});
}
private void putcomment(){
//进行图片评论的上传
String url = "http://47.107.52.7:88/member/photo/comment/first";
MediaType JSON = MediaType.parse("application/json;charset=utf-8");
JSONObject json=new JSONObject();
Log.d("yyyyyy","uuuuuu");
try {
json.put("content",et_mcomment.getText().toString());
json.put("shareId",sharerId);
json.put("userId",MainActivity.useridcode);
json.put("userName",MainActivity.Zusername);
Log.d("33333334433",et_mcomment.getText().toString());
}catch (Exception E){
Log.d("77777771111111111",E.toString());
}
RequestBody requestBody1 = RequestBody.create(JSON, String.valueOf(json));
OkHttpClient okHttpClient = new OkHttpClient();
final Request request = new Request.Builder()
.url(url)
.addHeader("appId", MainActivity.appId)
.addHeader("appSecret", MainActivity.appSecret)
.post(requestBody1)
// .get()
.build();
Call call = okHttpClient.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(@NonNull Call call, @NonNull IOException e) {
Log.d("456","890");
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
String B = response.body().string();
Log.d("21231321",B);
}
});
}
private void showcollect(){
//获取是否收藏
String url = "http://47.107.52.7:88/member/photo/share/detail?shareId="+sharerId+"&userId="+MainActivity.Zuseridcode;
OkHttpClient okHttpClient = new OkHttpClient();
Log.d("BIAOQIAN",sharerId+"?"+MainActivity.Zusername);
final Request request = new Request.Builder()
.url(url)
.addHeader("appId", MainActivity.appId)
.addHeader("appSecret", MainActivity.appSecret)
// .post(requestBody)
.get()
.build();
Call call = okHttpClient.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(@NonNull Call call, @NonNull IOException e) {
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
String B = response.body().string();
runOnUiThread(new Runnable() {
@Override
public void run() {
Gson gson = new Gson();
Iscollect iscollect =gson.fromJson(B,Iscollect.class);
iscollect1= iscollect.getData().getHascollect();
Home_ItemActivity.collectid = iscollect.getData().getCollect();
if (iscollect1 == "true"){
Log.d("123123123","........");
flag = true;
ig_collect.setImageResource(R.drawable.dynamic_is_selected);
}
else {
Log.d("123123123","0000000");
ig_collect.setImageResource(R.drawable.shouchang);
flag = false;
}
}
});
}
});
}
private void collect_chose(){
Log.d("SHOUCHANG","SHOUCHANG");
String url1 = "http://47.107.52.7:88/member/photo/collect";
// url = url+"?current="+"0"+"&size="+"10"+"&userId="+"1532321653437108224";
RequestBody requestBody = new FormBody.Builder()
.add("shareId", sharerId)
.add("userId",MainActivity.Zuseridcode)
.build();
Log.d("shareID",sharerId+"...");
OkHttpClient okHttpClient = new OkHttpClient();
final Request request = new Request.Builder()
.url(url1)
.addHeader("appId", MainActivity.appId)
.addHeader("appSecret", MainActivity.appSecret)
.post(requestBody)
.build();
Call call = okHttpClient.newCall(request);
List<Share.data.record> records111 = null;
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d("11111111", "onfailure");
// List<Share.data.record> records111 = null;
// return records111;
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
if (true) {
String b = response.body().string();
Log.d("pppppppb",b);
}
}
});
}
private void collect_delete(){
Log.d("NOSHOUCHANG","NOSHOUCHANG");
String url1 = "http://47.107.52.7:88/member/photo/collect/cancel";
// url = url+"?current="+"0"+"&size="+"10"+"&userId="+"1532321653437108224";
Log.d("collectid",Home_ItemActivity.collectid+"?");
RequestBody requestBody = new FormBody.Builder()
.add("collectId",Home_ItemActivity.collectid) //要进行传值
.build();
OkHttpClient okHttpClient = new OkHttpClient();
final Request request = new Request.Builder()
.url(url1)
.addHeader("appId", MainActivity.appId)
.addHeader("appSecret", MainActivity.appSecret)
.post(requestBody)
.build();
Call call = okHttpClient.newCall(request);
List<Share.data.record> records111 = null;
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d("11111111", "onfailure");
// List<Share.data.record> records111 = null;
// return records111;
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
if (true) {
String b = response.body().string();
Log.d("ppppppp",b);
}
}
});
}
private void initview(){
//初始化控件
igBack = findViewById(R.id.img_back_home);
igdetail = findViewById(R.id.ig_myshareimage);
tv_item_title = findViewById(R.id.tv_home_item_title);
tv_item_detail = findViewById(R.id.tv_home_item_detail);
tv_item_count = findViewById(R.id.home_item_commentscount);
ig_collect = findViewById(R.id.ig_home_item_collect);
bt_comment = findViewById(R.id.Comment);
CRecyclerview = findViewById(R.id.rv_home_item_commentlist);
et_mcomment = findViewById(R.id.home_item_Entercomments);
//输入评论内容
//初始化控件
//初始化评论列
commentList = new ArrayList<>();
ALLcommentList = new ArrayList<>();
CRecyclerview.setHasFixedSize(true);
ClayoutManager = new StaggeredGridLayoutManager(1,StaggeredGridLayoutManager.VERTICAL);
CRecyclerview.setLayoutManager(ClayoutManager);
/*********************************************************/
}
private void getitemmessage(){
/***********************获取item的信息**************************/
sharerId = this.getIntent().getStringExtra("sharerIdkey");
sharerName = this.getIntent().getStringExtra("shareNamekey");
hhuri = Uri.parse(this.getIntent().getStringExtra("hUrikey"));
itemId = this.getIntent().getIntExtra("itemidkey",0);
itemUri=this.getIntent().getStringExtra("imgUrikey");
itemtitle = this.getIntent().getStringExtra("titlekey");
itemdetail = this.getIntent().getStringExtra("detailkey");
itemHeight = this.getIntent().getIntExtra("imgHeight",0);
// igdetail.setImageURI(itemUri);
//放置图片
URL picUrl = null;
try {
picUrl = new URL(itemUri);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
HttpURLConnection conn = (HttpURLConnection) picUrl.openConnection();
conn.setDoInput(true);
conn.connect();
Bitmap pngBM = BitmapFactory.decodeStream(picUrl.openStream());
Log.d("123123123123",picUrl.toString());
igdetail.setImageBitmap(pngBM);
// 放置图片
// 分享者头像
}catch (Exception R){
Log.d("123123123123",R.toString());
}
tv_item_title.setText(itemtitle);
tv_item_detail.setText(itemdetail);
/***********************初始化控件**************************/
}
}

@ -0,0 +1,48 @@
package com.example.picture_sharing.Login;
import androidx.annotation.NonNull;
public class BaseResponse <T> {
private int code;
private String msg;
private T data;
public final static int RESPONSE_SUCCESS = 0;
public BaseResponse(){}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
@NonNull
@Override
public String toString() {
return "BaseResponse{" +
"code=" + code +
", msg='" + msg + '\'' +
", data=" + data +
'}';
}
}

@ -0,0 +1,182 @@
package com.example.picture_sharing.Login;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.picture_sharing.MainActivity;
import com.example.picture_sharing.R;
import com.example.picture_sharing.Register.RegisterActivity;
import com.example.picture_sharing.SQL.Login;
import com.google.gson.Gson;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
public ImageView PasswordVisibleImage;
public EditText PasswordText;
public EditText UserNameText;
public static String UserId;
public static String mpassword;
public static String mname;
public Button LoginButton;
public Button registerButton;
private Boolean bPwdSwitch = false;
private EditText etPwd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
initView();
PasswordVisibleImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
bPwdSwitch = !bPwdSwitch;
if (bPwdSwitch) {
PasswordVisibleImage.setImageResource(
R.drawable.ic_baseline_visibility_24);
etPwd.setInputType(
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
} else {
PasswordVisibleImage.setImageResource(
R.drawable.ic_baseline_visibility_off_24);
etPwd.setInputType(
InputType.TYPE_TEXT_VARIATION_PASSWORD |
InputType.TYPE_CLASS_TEXT);
etPwd.setTypeface(Typeface.DEFAULT);
}
}
});
}
public void initView(){
PasswordVisibleImage = findViewById(R.id.PasswordVisibleImage);
etPwd = findViewById(R.id.userPassword);
LoginButton = findViewById(R.id.loginButton);
registerButton = findViewById(R.id.registerButton);
UserNameText = findViewById(R.id.userName);
PasswordText = findViewById(R.id.userPassword);
UserNameText.setHintTextColor(Color.WHITE);
PasswordText.setHintTextColor(Color.WHITE);
LoginButton.setOnClickListener(this);
registerButton.setOnClickListener(this);
}
private static final String TAG ="LoginActivity";
void testOkhttp() throws IOException {
UserId = String.valueOf(UserNameText.getText());
MainActivity.Zusername = UserId;
Log.d("MAIN",MainActivity.Zusername+UserId);
mpassword = String.valueOf(PasswordText.getText());
RequestBody requestBody = new FormBody.Builder()
.add("password",mpassword)
.add("username",UserId)
.build();
String url = "http://47.107.52.7:88/member/photo/user/login";
OkHttpClient okHttpClient = new OkHttpClient();
final Request request = new Request.Builder()
.url(url)
.addHeader("appId",MainActivity.appId)
.addHeader("appSecret",MainActivity.appSecret)
.post(requestBody)
// .get()
.build();
Call call = okHttpClient.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d(TAG,"失败");
// Toast.makeText(MainActivity.this,"fall",Toast.LENGTH_SHORT).show();
}
@Override
public void onResponse(Call call,final Response response) throws IOException {
// Log.d(TAG,"onResponse:" + response.code());
if (true){
Log.d("123123", response.protocol() + " " +response.code() + " " + response.message() );
Gson gson= new Gson();
final String b = response.body().string();
BaseResponse baseResponse = gson.fromJson(b,BaseResponse.class);
if(baseResponse.getCode()!=200){
return;
}
runOnUiThread(new Runnable() {
@Override
public void run() {
Gson gson = new Gson();
Login userJson = gson.fromJson(b,Login.class);
//进行gson解析
// test.setText(Integer.toString(a));
// List<Login.JsonArrayBean> list = userJson.getJsonArray();
Login.JsonArrayBean array = userJson.getJsonArray();
// test.setText(array.getID());
Intent intent = new Intent(LoginActivity.this,MainActivity.class);
MainActivity.useridcode = array.getID();
MainActivity.Zuseridcode = array.getID();
Log.d("useidcode",MainActivity.Zuseridcode);
intent.putExtra("useridcode",array.getID());
startActivity(intent);
}
});
}
else {
Toast.makeText(LoginActivity.this,"fall",Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.loginButton:
UserId = String.valueOf(UserNameText.getText());
mpassword = String.valueOf(PasswordText.getText());
try{
testOkhttp();
Toast.makeText(LoginActivity.this,"登录成功!!",Toast.LENGTH_SHORT).show();
}catch (Exception e){
Toast.makeText(LoginActivity.this,"登录失败!!",Toast.LENGTH_SHORT).show();
}
break;
case R.id.registerButton:
Intent intent2 = new Intent(LoginActivity.this, RegisterActivity.class);
startActivity(intent2);
break;
}
}
}

@ -0,0 +1,238 @@
package com.example.picture_sharing;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.StrictMode;
import android.provider.Settings;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import com.example.picture_sharing.SQL.DataDTO;
import com.example.picture_sharing.SQL.File1;
import com.example.picture_sharing.SQL.FileUtil;
import com.example.picture_sharing.databinding.ActivityMainBinding;
import com.example.picture_sharing.publish.CreateMyPhotoActivity;
import com.example.picture_sharing.ui.home.HomeFragment;
import com.google.android.material.navigation.NavigationView;
import com.google.gson.Gson;
import java.io.File;
import java.io.IOException;
import cn.bmob.v3.Bmob;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class MainActivity extends AppCompatActivity {
public final static String appId = "9d0cba5fb4f349518f153761532f7465";
public final static String appSecret = "439891980521d512440a4a9223e57b3c3c4f2";
public static String useridcode;
private ImageView imageView ;
private AppBarConfiguration mAppBarConfiguration;
private ActivityMainBinding binding;
public static String Zuseridcode;
public static String Zusername;
public static String mFilePath;
public static String imgurl="1213";
public static String myh;
public static String obj;
// public View view;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_main);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.appBarMain.toolbar);
// view = inflater.inflate(R.layout.fragment_personal, container, false);
Bmob.initialize(this,"d310a8641bcdb58b8b3d79f0771173e5");
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
binding.appBarMain.fabu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
Intent intent = new Intent();
intent.setType("image/*");
//action表示intent的类型可以是查看、删除、发布或其他情况
// 选择ACTION_GET_CONTENT系统可以根据Type类型来调用系统程序选择Type
//由上,选择图片
intent.setAction(Intent.ACTION_PICK);
//设定请求码为1
startActivityForResult(intent,1);
}else {
Toast.makeText(MainActivity.this, "请授权手机储存权限!", Toast.LENGTH_LONG).show();
//跳转到应用设置界面
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getPackageName(), null);
intent.setData(uri);
startActivity(intent);
}
}
});
DrawerLayout drawer = binding.drawerLayout;
NavigationView navigationView = binding.navView;
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home,R.id.nav_personal)
.setOpenableLayout(drawer)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode){
case 1:
HomeFragment.randomnum = (int) (Math.random()*200+100);
HomeFragment.r = (int)(Math.random()*1000);
if (requestCode == 0x1 && resultCode == RESULT_OK) {
if (data != null) {
HomeFragment.imguri = data.getData();//返回图片路径
mFilePath = FileUtil.getPath(this, HomeFragment.imguri);
try {
testOkhttp1();
}catch (Exception E){
}
}
}
break;
}
}
private static final String TAG ="MainActivity";
void testOkhttp1() throws IOException {
// UserId = String.valueOf(UserNameText.getText());
// mpassword = String.valueOf(PasswordText.getText());
// 请求params
Log.d("12132123123",String.valueOf(HomeFragment.imguri));
MultipartBody.Builder builder = new MultipartBody.Builder().setType(MultipartBody.FORM);
File hhh = new File(mFilePath);
RequestBody fileBody = MultipartBody.create(MediaType.parse("image/jpg"),hhh);
builder.addFormDataPart("fileList", hhh.getName(), fileBody);
RequestBody body= builder.build();
String url = "http://47.107.52.7:88/member/photo/image/upload"; //
OkHttpClient okHttpClient = new OkHttpClient(); //
final Request request = new Request.Builder()
//
.url(url)
.addHeader("appId",MainActivity.appId)
.addHeader("appSecret",MainActivity.appSecret)
.post(body)
// .get() //请求参数加在别的地方
.build(); //
Call call = okHttpClient.newCall(request); //
// Log.d("12213223",);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d("11111111",e.toString()); //在Logcat中查看日志
// Toast.makeText(ButtonNagivation.this,"fall",Toast.LENGTH_SHORT).show();
}
//请求失败执行
@Override
public void onResponse(Call call,final Response response) throws IOException {
// Log.d(TAG,"onResponse:" + response.code()); //调试使用
if (true){
Log.d(TAG, response.protocol() + " " +response.code() + " " + response.message());
final String b = response.body().string(); //完整的body
runOnUiThread(new Runnable() {
@Override
public void run() {
Gson gson = new Gson(); //解析
File1 userJson = gson.fromJson(b,File1.class); //写一个File类
DataDTO userJsonData = userJson.getData();
String A = userJson.getCode();
imgurl = userJsonData.getImageCode();
Log.d("hhhhhhhhhhh",imgurl);
Intent intent2 = new Intent(MainActivity.this, CreateMyPhotoActivity.class);
Bundle bundle = new Bundle();
bundle.putParcelable("urikey",HomeFragment.imguri);
Log.d("213212323",imgurl);
intent2.putExtras(bundle);
// bundle.putString("IMGCODE",imgurl);
intent2.putExtra("IMGCODE",imgurl);
startActivity(intent2);
}
});
Gson gson = new Gson(); //解析
File1 userJson = gson.fromJson(b,File1.class); //File类
DataDTO userJsonData = userJson.getData();
String A = userJson.getCode();
String imagecode1 = userJsonData.getImageCode();
Log.d("12123132","b");
Log.d("12123132",b);
}
else {
}
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|| super.onSupportNavigateUp();
}
}

@ -0,0 +1,50 @@
package com.example.picture_sharing.Mine_Recycleview;
import android.net.Uri;
import java.io.Serializable;
public class Mine implements Serializable {
private Uri hUri;
private String Title;
private String Name;
private Uri shareUri;
public Mine(Uri hUri,String Title,String Name,Uri shareUri){
this.sethUri(hUri);
this.setTitle(Title);
this.setName(Name);
this.setShareUri(shareUri);
}
public Uri gethUri() {
return hUri;
}
public void sethUri(Uri hUri) {
this.hUri = hUri;
}
public String getTitle() {
return Title;
}
public void setTitle(String title) {
Title = title;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public Uri getShareUri() {
return shareUri;
}
public void setShareUri(Uri shareUri) {
this.shareUri = shareUri;
}
}

@ -0,0 +1,108 @@
package com.example.picture_sharing.Mine_Recycleview;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.picture_sharing.home.WaterfallAdapter;
import com.example.picture_sharing.R;
import org.jetbrains.annotations.NotNull;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
public class MineAdapter extends RecyclerView.Adapter {
public Context mContext;
public List<Mine> mdata;
public MineAdapter(Context mContext, List<Mine> mdata) {
this.mContext = mContext;
this.mdata = mdata;
}
@NonNull
@NotNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.recycleview_mine_item,null);
final WaterfallAdapter.MyViewHolder holder = new WaterfallAdapter.MyViewHolder(view);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull @NotNull RecyclerView.ViewHolder holder, int position) {
MyViewHolder holder1 = (MyViewHolder) holder;
Mine mine = mdata.get(position);
final int[] count = {0};
if(mine.gethUri()!=null&&mine.gethUri()!=null) {
// if (true){
Log.d("000000000", "123123123");
holder1.m_himage.setImageURI(mine.gethUri());////
// picUrl = new URL(getIntent().getExtras().getString("map_url"));
URL picUrl = null;
try {
picUrl = new URL(mine.gethUri().toString());
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
HttpURLConnection conn = (HttpURLConnection) picUrl.openConnection();
conn.setDoInput(true);
conn.connect();
Bitmap pngBM = BitmapFactory.decodeStream(picUrl.openStream());
Log.d("123123123123", mine.gethUri().toString());
holder1.m_image.setImageBitmap(pngBM);
} catch (Exception R) {
Log.d("123123123123", R.toString());
}
}
holder1.m_himage.setImageResource(R.drawable.touxiang);
// holder1.m_himage.setImageURI(mine.hUri);
holder1.m_Name.setText(mine.getName());
holder1.m_Title.setText(mine.getTitle());
// holder1.m_image.setImageURI(mine.shareUri);
}
@Override
public int getItemCount() {
if(mdata!=null){
return mdata.size();
}
return 0;
}
public static class MyViewHolder extends RecyclerView.ViewHolder{
ImageView m_himage;
ImageView m_image;
TextView m_Title;
TextView m_Name;
public MyViewHolder(@NonNull @NotNull View itemView) {
super(itemView);
m_himage = (ImageView)itemView.findViewById(R.id.m_hImg);
m_image = (ImageView)itemView.findViewById(R.id.m_Pic);
m_Title = (TextView)itemView.findViewById(R.id.m_Title);
m_Name = (TextView)itemView.findViewById(R.id.m_Name);
}
}
}

@ -0,0 +1,170 @@
package com.example.picture_sharing.Person_RecycleView;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.example.picture_sharing.Home_ItemActivity;
import com.example.picture_sharing.R;
import org.jetbrains.annotations.NotNull;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
public class CollectionAdapter extends RecyclerView.Adapter{
public Context mContext;
public List<MyCollection> mdata;
public CollectionAdapter(Context mContext, List<MyCollection> mdata){
this.mContext=mContext;
this.mdata=mdata;
}
@NonNull
@NotNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.recycleview_person_item,null);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull @NotNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
final MyViewHolder holder2 = (MyViewHolder) holder;
MyCollection myCollection = mdata.get(position);
final int[] count = {0};
if (myCollection.gethUri() != null && myCollection.getImgUri() != null) {
// if (true){
Log.d("0000000011111111", "123123123");
holder2.mImage.setImageURI(Uri.parse(myCollection.gethUri()));////
// picUrl = new URL(getIntent().getExtras().getString("map_url"));
// URL picUrl = null;
// try {
// picUrl = new URL(myCollection.gethUri().toString());
// } catch (MalformedURLException e) {
// e.printStackTrace();
// }
// try {
// HttpURLConnection conn = (HttpURLConnection) picUrl.openConnection();
// conn.setDoInput(true);
// conn.connect();
// Bitmap pngBM = BitmapFactory.decodeStream(picUrl.openStream());
// Log.d("123123123123", myCollection.gethUri().toString());
// holder2.sharerimgae.setImageResource(R.drawable.touxiang);
// holder2.mImage.setImageBitmap(pngBM);
// } catch (Exception R) {
// Log.d("123123123123", R.toString());
// }
Glide.with(mContext)
.load(myCollection.gethUri())
.into(holder2.mImage);
// holder2.mImage.setImageURI(Uri.parse(myCollection.getImgUri()));
holder2.mTitle.setText(myCollection.getTitle());
holder2.mImage.getLayoutParams().height = myCollection.getImgheight();
// holder2.sharerimgae.setImageURI(Uri.parse(myCollection.gethUri()));
holder2.sharername.setText(myCollection.getSharerName());
}
holder2.personcardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext,
Home_ItemActivity.class);
Bundle bundle = new Bundle();
// int userId = mdata.get(position).getUserId();
//userid----sharename
// String sharerName = mdata.get(position).getSharerName();
// int mmsharerId = mdata.get(position).getSharerId();
// String mmhUri = mdata.get(position).gethUri();
// int itemId = mdata.get(position).getItemId();
// String mmimghUri = mdata.get(position).getImgUri();
// String mmTitle = holder2.mTitle.getText().toString();
// String mmDetail = mdata.get(position).getDetail();
// int mmHeight = mdata.get(position).getImgheight();
int userId = mdata.get(position).getUserId();
String sharerName =mdata.get(position).getSharerName();
int mmsharerId = mdata.get(position).getUserId();
String mmhUri = mdata.get(position).getImgUri();
String itemId = ""+mdata.get(position).getItemId();
String mmimghUri = mdata.get(position).getImgUri();
String mmTitle = holder2.mTitle.getText().toString();
String mmDetail = mdata.get(position).getDetail();
int mmHeight = 0;
Log.d("uuuuuuu",itemId);
intent.putExtras(bundle);
intent.putExtra("UserIdkey",userId);
intent.putExtra("sharerNamekey",sharerName);
intent.putExtra("sharerIdkey",itemId);
intent.putExtra("hUrikey",mmhUri);
intent.putExtra("itemidkey",itemId);
intent.putExtra("imgUrikey",mmimghUri);
intent.putExtra("titlekey",mmTitle);
intent.putExtra("detailkey",mmDetail);
intent.putExtra("imgHeight",mmHeight);
mContext.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
if(mdata!=null){
return mdata.size();
}
return 0;
}
// 删除item
public void removeData(int position) {
mdata.remove(position);
notifyItemRemoved(position);
notifyDataSetChanged();
}
private static class MyViewHolder extends RecyclerView.ViewHolder{
public ImageView mImage;
public TextView mTitle;
public ImageView Heart;
public TextView mcount;
public CardView personcardView;
public ImageView deletehomeitem;
public ImageView sharerimgae;
public TextView sharername;
public MyViewHolder(@NonNull @NotNull View itemView) {
super(itemView);
mImage = (ImageView) itemView.findViewById(R.id.iv_person_shareimage);
mTitle = (TextView) itemView.findViewById(R.id.collection_title);
Heart = (ImageView) itemView.findViewById(R.id.person_love_selected);
mcount = (TextView) itemView.findViewById(R.id.person_count);
personcardView = (CardView) itemView.findViewById(R.id.cd_person_item);
sharername = (TextView)itemView.findViewById(R.id.p_shareName);
sharerimgae = (ImageView) itemView.findViewById(R.id.p_sharerhimg);
}
}
}

@ -0,0 +1,105 @@
package com.example.picture_sharing.Person_RecycleView;
import cn.bmob.v3.BmobObject;
public class MyCollection extends BmobObject {
private int userId;
private int sharerId;
private String sharerName;
private String hUri;
private int itemId;
private String imgUri;
private String title;
private String detail;
private int imgheight;
public MyCollection(int userId, int sharerId, String sharerName, String hUri, int itemId, String imgUri, String title, String detail, int imgheight) {
this.userId = userId;
this.sharerId = sharerId;
this.sharerName = sharerName;
this.hUri = hUri;
this.itemId = itemId;
this.imgUri = imgUri;
this.title = title;
this.detail = detail;
this.imgheight = imgheight;
}
public MyCollection() {
}
public String getImgUri() {
return imgUri;
}
public void setImgUri(String imgUri) {
this.imgUri = imgUri;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public int getImgheight() {
return imgheight;
}
public void setImgheight(int imgheight) {
this.imgheight = imgheight;
}
public int getItemId() {
return itemId;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getSharerName() {
return sharerName;
}
public void setSharerName(String sharerName) {
this.sharerName = sharerName;
}
public String gethUri() {
return hUri;
}
public void sethUri(String hUri) {
this.hUri = hUri;
}
public int getSharerId() {
return sharerId;
}
public void setSharerId(int sharerId) {
this.sharerId = sharerId;
}
}

@ -0,0 +1,132 @@
package com.example.picture_sharing.Register;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.picture_sharing.MainActivity;
import com.example.picture_sharing.R;
import com.example.picture_sharing.SQL.User;
import org.json.JSONObject;
import java.io.IOException;
import cn.bmob.v3.Bmob;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import pl.com.salsoft.sqlitestudioremote.SQLiteStudioService;
public class RegisterActivity extends AppCompatActivity implements View.OnClickListener {
public EditText registername;
public EditText registerpassword;
public EditText reconfirmpassword;
public Button bt_register;
public Button bt_cancel;
public static int k = 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
Bmob.initialize(this,"d310a8641bcdb58b8b3d79f0771173e5");
SQLiteStudioService.instance().start(this);
// this.getSupportActionBar().hide();//隐藏标题栏
inintView();
}
public void inintView(){
registername = findViewById(R.id.ruserName);
registerpassword = findViewById(R.id.ruserPassword);
reconfirmpassword = findViewById(R.id.ruserPassword1);
bt_register = findViewById(R.id.register);
bt_cancel = findViewById(R.id.cancel);
bt_register.setOnClickListener(this);
bt_cancel.setOnClickListener(this);
}
public void onClick(View view) {
switch (view.getId()){
case R.id.register:
String name = registername.getText().toString().trim();//trim去掉字符串两端的多余的空格
String password = registerpassword.getText().toString().trim();
String Rpassword = reconfirmpassword.getText().toString().trim();
if(!TextUtils.isEmpty(name)//三者不为空
&&!TextUtils.isEmpty(password)
&&!TextUtils.isEmpty(Rpassword)) {
if(password.equals(Rpassword)){//判断两次密码是否相同
MediaType JSON = MediaType.parse("application/json;charset=utf-8");
JSONObject json=new JSONObject();
try {
json.put("password",password);
json.put("username",name);
}catch (Exception E){
Log.d("7777777",E.toString());
}
RequestBody requestBody1 = RequestBody.create(JSON, String.valueOf(json)); //封装json数据
String url = "http://47.107.52.7:88/member/photo/user/register";
OkHttpClient okHttpClient = new OkHttpClient();
final Request request = new Request.Builder()
.url(url)
.addHeader("appId", MainActivity.appId)
.addHeader("appSecret",MainActivity.appSecret)
.post(requestBody1)
.build();
Call call = okHttpClient.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call,final Response response) throws IOException {
if (response.code()==200){
Log.d("1889", response.code()+"yess!!!!");
}
else {
Log.d("8877","false!!!!!!!!!");
}
}
});
final User user = new User();
user.setUserId(k);
user.setName(name);
user.setPassword(password);
user.save(new SaveListener<String>() {
@Override
public void done(String objectId, BmobException e) {
k++;
}
});
Toast.makeText(RegisterActivity.this,"注册成功!",Toast.LENGTH_SHORT).show();
finish();
}
}
/**************************************************************/
break;
case R.id.cancel:
finish();
break;
}
}
}

@ -0,0 +1,211 @@
package com.example.picture_sharing.SQL;
import java.util.List;
public class Collection {
private int code;
private String msg;
private DataDTO data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public DataDTO getData() {
return data;
}
public void setData(DataDTO data) {
this.data = data;
}
public static class DataDTO {
private List<RecordsDTO> records;
private int total;
private int size;
private int current;
public List<RecordsDTO> getRecords() {
return records;
}
public void setRecords(List<RecordsDTO> records) {
this.records = records;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getCurrent() {
return current;
}
public void setCurrent(int current) {
this.current = current;
}
public static class RecordsDTO {
private String id;
private String pUserId;
private String imageCode;
private String title;
private String content;
private String createTime;
private List<String> imageUrlList;
private Object likeId;
private Object likeNum;
private boolean hasLike;
private Object collectId;
private Object collectNum;
private boolean hasCollect;
private boolean hasFocus;
private String username;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getPUserId() {
return pUserId;
}
public void setPUserId(String pUserId) {
this.pUserId = pUserId;
}
public String getImageCode() {
return imageCode;
}
public void setImageCode(String imageCode) {
this.imageCode = imageCode;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public List<String> getImageUrlList() {
return imageUrlList;
}
public void setImageUrlList(List<String> imageUrlList) {
this.imageUrlList = imageUrlList;
}
public Object getLikeId() {
return likeId;
}
public void setLikeId(Object likeId) {
this.likeId = likeId;
}
public Object getLikeNum() {
return likeNum;
}
public void setLikeNum(Object likeNum) {
this.likeNum = likeNum;
}
public boolean isHasLike() {
return hasLike;
}
public void setHasLike(boolean hasLike) {
this.hasLike = hasLike;
}
public Object getCollectId() {
return collectId;
}
public void setCollectId(Object collectId) {
this.collectId = collectId;
}
public Object getCollectNum() {
return collectNum;
}
public void setCollectNum(Object collectNum) {
this.collectNum = collectNum;
}
public boolean isHasCollect() {
return hasCollect;
}
public void setHasCollect(boolean hasCollect) {
this.hasCollect = hasCollect;
}
public boolean isHasFocus() {
return hasFocus;
}
public void setHasFocus(boolean hasFocus) {
this.hasFocus = hasFocus;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
}
}

@ -0,0 +1,13 @@
package com.example.picture_sharing.SQL;
public class DataDTO {
private String imageCode;
public String getImageCode() {
return imageCode;
}
public void setImageCode(String imageCode) {
this.imageCode = imageCode;
}
}

@ -0,0 +1,26 @@
package com.example.picture_sharing.SQL;
import com.google.gson.annotations.SerializedName;
public class File1 {
private DataDTO data;
@SerializedName("code")
private String code;
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
@SerializedName("data")
public DataDTO getData() {
return data;
}
public void setData(DataDTO data) {
this.data = data;
}
}

@ -0,0 +1,171 @@
package com.example.picture_sharing.SQL;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import androidx.annotation.RequiresApi;
import java.io.File;
/**
*
*/
public class FileUtil {
/**
* Android4.4Uri使
*/
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
//一些三方的文件浏览器会进入到这个方法中例如ES
//QQ文件管理器不在此列
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
if ("primary".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
}
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
// 不同系统获取的id开头可能不一样在这后面便是真实的地址
if (id.startsWith("msf:")) {
return id.replaceFirst("msf:", "");
}
final Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
else if (isMediaDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
Uri contentUri = null;
if ("image".equals(type)) {
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if ("video".equals(type)) {
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if ("audio".equals(type)) {
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
final String selection = "_id=?";
final String[] selectionArgs = new String[]{split[1]};
return getDataColumn(context, contentUri, selection, selectionArgs);
}
} else if ("content".equalsIgnoreCase(uri.getScheme())) {// MediaStore (and general)
// Return the remote address
if (isGooglePhotosUri(uri))
return uri.getLastPathSegment();
if (isQQMediaDocument(uri)) {
String path = uri.getPath();
File fileDir = Environment.getExternalStorageDirectory();
File file = new File(fileDir, path.substring("/QQBrowser".length(), path.length()));
return file.exists() ? file.toString() : null;
}
return getDataColumn(context, uri, null, null);
} else if ("file".equalsIgnoreCase(uri.getScheme())) {// File
return uri.getPath();
}
return null;
}
/**
* Get the value of the data column for this Uri. This is useful for
* MediaStore Uris, and other file-based ContentProviders.
*
* @param context The context.
* @param uri The Uri to query.
* @param selection (Optional) Filter used in the query.
* @param selectionArgs (Optional) Selection arguments used in the query.
* @return The value of the _data column, which is typically a file path.
*/
public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
Cursor cursor = null;
final String column = MediaStore.MediaColumns.DATA;
final String[] projection = {column};
try {
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
if (cursor != null && cursor.moveToFirst()) {
final int column_index = cursor.getColumnIndexOrThrow(column);
return cursor.getString(column_index);
}
} finally {
if (cursor != null)
cursor.close();
}
return null;
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is ExternalStorageProvider.
*/
public static boolean isExternalStorageDocument(Uri uri) {
return "com.android.externalstorage.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is DownloadsProvider.
*/
public static boolean isDownloadsDocument(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is MediaProvider.
*/
public static boolean isMediaDocument(Uri uri) {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
/**
* 使qq
*
* @param uri
* @return
*/
public static boolean isQQMediaDocument(Uri uri) {
return "com.tencent.mtt.fileprovider".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is Google Photos.
*/
public static boolean isGooglePhotosUri(Uri uri) {
return "com.google.android.apps.photos.content".equals(uri.getAuthority());
}
}

@ -0,0 +1,39 @@
package com.example.picture_sharing.SQL;
import com.google.gson.annotations.SerializedName;
public class Iscollect {
@SerializedName("data")
private cdata data;
public cdata getData() {
return data;
}
public void setData(cdata data) {
this.data = data;
}
public class cdata{
@SerializedName("hasCollect")
private String hascollect;
@SerializedName("collectId")
private String collect;
public void setCollect(String collect) {
this.collect = collect;
}
public String getCollect() {
return collect;
}
public void setHascollect(String hascollect) {
this.hascollect = hascollect;
}
public String getHascollect() {
return hascollect;
}
}
}

@ -0,0 +1,62 @@
package com.example.picture_sharing.SQL;
import com.google.gson.annotations.SerializedName;
public class Login {
private String username1;
public String getId1() {
return id1;
}
public void setId1(String id1) {
this.id1 = id1;
}
public String getUsername1() {
return username1;
}
public void setUsername1(String username1) {
this.username1 = username1;
}
public JsonArrayBean getJsonArray() {
return jsonArray;
}
public void setJsonArray(JsonArrayBean jsonArray) {
this.jsonArray = jsonArray;
}
public class JsonArrayBean{
public String getID() {
return ID;
}
public void setID(String id1) {
this.ID = id1;
}
public String getNAME() {
return NAME;
}
public void setNAME(String id1) {
this.NAME = id1;
}
@SerializedName("id")
private String ID;
@SerializedName("username")
private String NAME;
}
@SerializedName("msg")
private String id1;
@SerializedName("data")
private JsonArrayBean jsonArray;
}

@ -0,0 +1,118 @@
package com.example.picture_sharing.SQL;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List;
public class Share implements Serializable {
@SerializedName("code")
private String code;
@SerializedName("data")
private data data;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Share.data getData() {
return data;
}
public void setData(Share.data data) {
this.data = data;
}
public class data{
@SerializedName("total")
private String total;
@SerializedName("records")
private List<record> record;
public class record{
@SerializedName("id")
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@SerializedName("imageUrlList")
private String[] imgurl;
@SerializedName("username")
private String username;
@SerializedName("title")
private String title;
@SerializedName("likeNum")
private String likenum;
//点赞数
@SerializedName("content")
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getLikenum() {
return likenum;
}
public void setLikenum(String likenum) {
this.likenum = likenum;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
//
public String[] getImgurl() {
return imgurl;
}
public void setImgurl(String[] imgurl) {
this.imgurl = imgurl;
}
}
public List<record> getRecord() {
return record;
}
public void setRecord(List<record> record) {
this.record = record;
}
public String getTotal() {
return total;
}
public void setTotal(String total) {
this.total = total;
}
}
}

@ -0,0 +1,49 @@
package com.example.picture_sharing.SQL;
import cn.bmob.v3.BmobObject;
public class User extends BmobObject {
private int userId;
private String name; //用户名
private String password; //密码
private String hUri;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "User{" +
"name='" + getName() + '\'' +
", password='" + getPassword() + '\'' +
", hUri='" + gethUri() +
", id='" + getUserId() +
'}';
}
public String gethUri() {
return hUri;
}
public void sethUri(String hUri) {
this.hUri = hUri;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
}

@ -0,0 +1,227 @@
package com.example.picture_sharing.home;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.example.picture_sharing.Home_ItemActivity;
import com.example.picture_sharing.MainActivity;
import com.example.picture_sharing.R;
import com.example.picture_sharing.SQL.Share;
import com.google.gson.Gson;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class WaterfallAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
public Context mContext;
public List<Share.data.record> mdata;
public WaterfallAdapter(Context mContext, List<Share.data.record> mdata){
this.mContext=mContext;
System.out.println(mContext);
this.mdata=mdata;
}
@NonNull
@NotNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.recycleview_home_item,null);
// 界面的adapter绑定的页面分布
final MyViewHolder holder = new MyViewHolder(view);
Log.d("000000000","123123123");
return new MyViewHolder(view);
}
public void test(){
String a = mdata.get(0).getId();
Log.d("qqqqqqqqq",a);
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
final MyViewHolder holder2 = (MyViewHolder) holder;
holder2.setIsRecyclable(false);
final Share.data.record mydynamic = mdata.get(position);
final boolean[] flag = {false};
final int[] count = {0};
if(Uri.parse(mydynamic.getImgurl()[0])!=null&&mydynamic.getImgurl()[0]!=null){
// if (true){
Log.d("000000000","123123123");
holder2.mImage.setImageURI(Uri.parse(mydynamic.getImgurl()[0]));////
// picUrl = new URL(getIntent().getExtras().getString("map_url"));
// URL picUrl = null;
// try {
// picUrl = new URL(mydynamic.getImgurl()[0]);
// } catch (MalformedURLException e) {
// e.printStackTrace();
// }
//
// try {
//
// HttpURLConnection conn = (HttpURLConnection) picUrl.openConnection();
// conn.setDoInput(true);
// conn.connect();
// Bitmap pngBM = BitmapFactory.decodeStream(picUrl.openStream());
// Log.d("123123123123",picUrl.toString());
// Log.d("wcsl",String.valueOf(pngBM));
// holder2.mImage.setImageBitmap(pngBM);
// // 放置图片
//// holder2.sharerh.setImageBitmap(pngBM);
// // 分享者头像
// }catch (Exception R){
// Log.d("123123123123",R.toString());
// }
Glide.with(mContext)
.load(mydynamic.getImgurl()[0])
.into(holder2.mImage);
holder2.sharerh.setImageResource(R.drawable.touxiang);
Log.d("555555",Uri.parse(mydynamic.getImgurl()[0]).toString());
holder2.mImage.getLayoutParams().height = 800;
// 设置每个图片的高度
holder2.mTitle.setText(mydynamic.getTitle());
// 标题
int num = 0;
if (mydynamic.getLikenum()==null){
num = 0;
}else {
num = Integer.valueOf(mydynamic.getLikenum());
}
holder2.mcount.setText(Integer.toString(num));
holder2.sharername.setText(mydynamic.getUsername());
}
/**************设置卡片布局的点击事件**************/
//跳转界面并完成数据传输
holder2.homecardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext, Home_ItemActivity.class);
String mmObjectId = "123123";
String mmhUri = "null";
String mmImgUri = mdata.get(position).getImgurl()[0];
String mmsharerId = mdata.get(position).getId();
String mmsharerName = mdata.get(position).getUsername();
int itemId = 0;
String mmTitle = mdata.get(position).getTitle();
String mmDetail = mdata.get(position).getContent();
int mmHeight = 800;
intent.putExtra("ObjectIdkey",mmObjectId);
intent.putExtra("sharerIdkey",mmsharerId);
intent.putExtra("shareNamekey",mmsharerName);
intent.putExtra("hUrikey",mmhUri);
intent.putExtra("imgUrikey",mmImgUri);
intent.putExtra("itemidkey",itemId);
intent.putExtra("titlekey",mmTitle);
intent.putExtra("detailkey",mmDetail);
intent.putExtra("imgHeight",mmHeight);
mContext.startActivity(intent);
}
});
/**************设置卡片布局的点击事件**************/
/**********************删除一个Item***********************/
holder2.deletehomeitem.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
removeData(position);
// 主界面删除一个图片adapter的
Toast.makeText(mContext,"删除成功!",Toast.LENGTH_SHORT).show();
}
});
/**********************删除一个Item***********************/
}
@Override
public int getItemCount() {
if(mdata!=null){
// Log.d("1215",Integer.toString(mdata.size()));
return mdata.size();
// return 0;
}
// Log.d("135",Integer.toString(mdata.size()));
return 0;
}
// 删除item
public void removeData(int position) {
mdata.remove(position);
notifyItemRemoved(position);
notifyDataSetChanged();
}
public static class MyViewHolder extends RecyclerView.ViewHolder{//初始化控件
public ImageView mImage;
public TextView mTitle;
public ImageView Heart;
;
public TextView mcount;
public CardView homecardView;
public ImageView deletehomeitem;
public ImageView sharerh;
public TextView sharername;
public MyViewHolder(@NonNull @NotNull View itemView) {
super(itemView);
// testtext = (TextView) itemView.findViewById(R.id.testtext1);
mImage = (ImageView) itemView.findViewById(R.id.iv_shareimage);
mTitle = (TextView) itemView.findViewById(R.id.mytitle);
Heart = (ImageView) itemView.findViewById(R.id.love_selected);
mcount = (TextView) itemView.findViewById(R.id.count);
homecardView = (CardView)itemView.findViewById(R.id.cd_home_item);
deletehomeitem = (ImageView)itemView.findViewById(R.id.ig_home_item_delete);
sharerh = (ImageView)itemView.findViewById(R.id.h_item_sharerig);
sharername = (TextView)itemView.findViewById(R.id.h_item_sharername);
}
}
}

@ -0,0 +1,94 @@
package com.example.picture_sharing.publish;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.picture_sharing.R;
import org.jetbrains.annotations.NotNull;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
public class CommentAdapter extends RecyclerView.Adapter {
public Context context;
public List<Mycomment.sdata.pcomment> mycommentList;
public CommentAdapter(Context context, List<Mycomment.sdata.pcomment> mycommentList) {
this.context = context;
this.mycommentList = mycommentList;
}
@NonNull
@NotNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.recycleview_home_item_comments,null);
MyViewHolder holder = new MyViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull @NotNull RecyclerView.ViewHolder holder, int position) {
MyViewHolder holder1 = (MyViewHolder)holder;
holder1.setIsRecyclable(false);
Mycomment.sdata.pcomment mycomment = mycommentList.get(position);
String url = "https://guet-lab.oss-cn-guangzhou.aliyuncs.com/api/2022/06/06/login.jpg";
URL picUrl = null;
try {
picUrl = new URL(url);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
HttpURLConnection conn = (HttpURLConnection) picUrl.openConnection();
conn.setDoInput(true);
conn.connect();
Bitmap pngBM = BitmapFactory.decodeStream(picUrl.openStream());
Log.d("abc",picUrl.toString());
// holder1.img_user.setImageBitmap(pngBM);
// 放置图片
// 分享者头像
}catch (Exception R){
Log.d("error",R.toString());
}
holder1.img_user.setImageResource(R.drawable.touxiang);
holder1.tv_userId.setText(mycomment.getUsername());
holder1.tv_usercomments.setText(mycomment.getContent());
}
@Override
public int getItemCount() {
if(mycommentList!=null){
return mycommentList.size();
}
return 0;
}
public static class MyViewHolder extends RecyclerView.ViewHolder{
public ImageView img_user;
public TextView tv_userId;
public TextView tv_usercomments;
public MyViewHolder(@NonNull @NotNull View itemView) {
super(itemView);
img_user = (ImageView) itemView.findViewById(R.id.comment_userimg);
tv_userId = (TextView) itemView.findViewById(R.id.comment_username);
tv_usercomments = (TextView) itemView.findViewById(R.id.comment_usercomment);
}
}
}

@ -0,0 +1,154 @@
package com.example.picture_sharing.publish;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.picture_sharing.MainActivity;
import com.example.picture_sharing.R;
import org.json.JSONObject;
import java.io.IOException;
import java.util.List;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class CreateMyPhotoActivity extends AppCompatActivity implements View.OnClickListener{
public static ImageView addimg;
public static EditText ettitle;
public static EditText etdetail;
public static Button btcancel;
public static Button btdetermine;
public static Mydynamic m;
public static List<Mydynamic> list;
public Uri uri;
public static int k=0;
public static String imagecode;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create_my_photo);
// 新建图片分享界面
//this.getSupportActionBar().hide();//隐藏标题栏
initview();
}
private void initview(){
addimg = findViewById(R.id.addmImage);
ettitle = findViewById(R.id.et_gettitle);
etdetail = findViewById(R.id.et_getdetail);
btcancel = findViewById(R.id.bt_cancel);
btdetermine = findViewById(R.id.bt_determine);
uri = this.getIntent().getParcelableExtra("urikey");
addimg.setImageURI(uri);
btdetermine.setOnClickListener(this);
btcancel.setOnClickListener(this);
}
private static final String TAG ="CreateMyPhotoActivity";
void testOkhttp151515() throws IOException {
Intent intent = getIntent();
imagecode = intent.getStringExtra("IMGCODE");
MediaType JSON = MediaType.parse("application/json;charset=utf-8");
JSONObject json=new JSONObject();
try {
json.put("content",etdetail.getText().toString());
json.put("id",k);
json.put("imageCode",imagecode);
json.put("pUserId", MainActivity.Zuseridcode);
json.put("title",ettitle.getText().toString());
Log.d("qwe",String.valueOf(k));
}catch (Exception E){
Log.d("pljh",E.toString());
}
Log.d("yugv",imagecode+"///12121");
RequestBody requestBody1 = RequestBody.create(JSON, String.valueOf(json)); //
//intent
Log.d("lss",ettitle.getText().toString()+"///"+etdetail.getText().toString());
String url = "http://47.107.52.7:88/member/photo/share/add"; //
OkHttpClient okHttpClient = new OkHttpClient(); //
final Request request = new Request.Builder() //
.url(url)
.addHeader("Content-Type","application/json")
.addHeader("appId",MainActivity.appId)
.addHeader("appSecret",MainActivity.appSecret)
.post(requestBody1)
// .get() //请求参数加在别的地方
.build(); //
Call call = okHttpClient.newCall(request); //
call.enqueue(new Callback() { //异步请求
@Override
public void onFailure(Call call, IOException e) {
Log.d("hhhhh","onfailure"); //在Logcat中查看日志
Toast.makeText(CreateMyPhotoActivity.this,"fall",Toast.LENGTH_SHORT).show();
}
//请求失败执行
@Override
public void onResponse(Call call,final Response response) throws IOException {
Log.d(TAG,"onResponse:" + response.code());
int a = response.code();
final String b = response.body().string(); //完整的body
Log.d("gggg",Integer.toString(a));
Log.d("iiii",b);
runOnUiThread(new Runnable() {
@Override
public void run() {
}
});
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.bt_determine:
if(ettitle.getText().toString().equals("")
||etdetail.getText().toString().equals("")){
Toast.makeText(CreateMyPhotoActivity.this,"请完善标题或内容",Toast.LENGTH_SHORT).show();
}
else {
k++;
Log.d("bbb","15454156156");
try {
testOkhttp151515();
} catch (IOException e) {
e.printStackTrace();
Log.d("886",e.toString());
}
finish();
}
break;
case R.id.bt_cancel:
finish();
break;
}
}
}

@ -0,0 +1,95 @@
package com.example.picture_sharing.publish;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class Mycomment {
@SerializedName("code")
private String code;
@SerializedName("data")
private sdata data;
public sdata getData() {
return data;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public void setData(sdata data) {
this.data = data;
}
public class sdata{
@SerializedName("total")
private String total;
@SerializedName("records")
private List<pcomment> records;
public void setRecords(List<pcomment> records) {
this.records = records;
}
public List<pcomment> getRecords() {
return records;
}
public void setTotal(String total) {
this.total = total;
}
public String getTotal() {
return total;
}
public class pcomment{
@SerializedName("userName")
private String username;
@SerializedName("content")
private String content;
@SerializedName("id")
private String id;
@SerializedName("shareId")
private String shareId;
public String getContent() {
return content;
}
public String getUsername() {
return username;
}
public String getId() {
return id;
}
public String getShareId() {
return shareId;
}
public void setContent(String content) {
this.content = content;
}
public void setUsername(String username) {
this.username = username;
}
public void setId(String id) {
this.id = id;
}
public void setShareId(String shareId) {
this.shareId = shareId;
}
}
}
}

@ -0,0 +1,103 @@
package com.example.picture_sharing.publish;
import java.io.Serializable;
import cn.bmob.v3.BmobObject;
import cn.bmob.v3.datatype.BmobFile;
public class Mydynamic extends BmobObject implements Serializable {
// BmobObject 表示后端云的类
private Integer sharerId;
private String sharerName;
private String hUri;
private Integer itemId;
private String Mytitle;
private String Mydetail;
private int imgheight;
private String imgUri;
private int NumberOfLikes;
private BmobFile picture;
public Integer getSharerId() {
return sharerId;
}
public void setSharerId(Integer sharerId) {
this.sharerId = sharerId;
}
public String getSharerName() {
return sharerName;
}
public void setSharerName(String sharerName) {
this.sharerName = sharerName;
}
public String gethUri() {
return hUri;
}
public void sethUri(String hUri) {
this.hUri = hUri;
}
public Integer getItemId() {
return itemId;
}
public void setItemId(Integer itemId) {
this.itemId = itemId;
}
public String getMytitle() {
return Mytitle;
}
public void setMytitle(String mytitle) {
Mytitle = mytitle;
}
public String getMydetail() {
return Mydetail;
}
public void setMydetail(String mydetail) {
Mydetail = mydetail;
}
public int getImgheight() {
return imgheight;
}
public void setImgheight(int imgheight) {
this.imgheight = imgheight;
}
public String getImgUri() {
return imgUri;
}
public void setImgUri(String imgUri) {
this.imgUri = imgUri;
}
public int getNumberOfLikes() {
return NumberOfLikes;
}
public void setNumberOfLikes(int numberOfLikes) {
NumberOfLikes = numberOfLikes;
}
public BmobFile getPicture() {
return picture;
}
public void setPicture(BmobFile picture) {
this.picture = picture;
}
}

@ -0,0 +1,163 @@
package com.example.picture_sharing.ui.home;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.example.picture_sharing.MainActivity;
import com.example.picture_sharing.R;
import com.example.picture_sharing.SQL.Share;
import com.example.picture_sharing.databinding.FragmentHomeBinding;
import com.example.picture_sharing.home.WaterfallAdapter;
import com.google.gson.Gson;
import java.io.IOException;
import java.util.List;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class HomeFragment extends Fragment {
private FragmentHomeBinding binding;
public View view;
private static String b;
public List<Share.data.record> list;
public static RecyclerView.LayoutManager mlayoutmanager;
public static WaterfallAdapter mAdapter;
public static RecyclerView mRecyclerView;
public static int randomnum;
public static Uri imguri;
public static int r;
private ImageView imageView,imgdetail;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
HomeViewModel homeViewModel =
new ViewModelProvider(this).get(HomeViewModel.class);
// binding = FragmentHomeBinding.inflate(inflater, container, false);
// View root = binding.getRoot();
//
// final TextView textView = binding.textHome;
// homeViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
view = inflater.inflate(R.layout.fragment_home, container, false);
initView();
picture();
return view;
}
void picture(){
Log.d("useridcode","21231");
RequestBody requestBody = new FormBody.Builder()
.add("current", "0")
.add("size", "100")
.build();
String url1 = "http://47.107.52.7:88/member/photo/share?current=0&size=100&userId="+MainActivity.Zuseridcode;
// url = url+"?current="+"0"+"&size="+"10"+"&userId="+"1532321653437108224";
OkHttpClient okHttpClient = new OkHttpClient();
final Request request = new Request.Builder()
.url(url1)
.addHeader("appId", MainActivity.appId)
.addHeader("appSecret", MainActivity.appSecret)
.get()
.build();
Call call = okHttpClient.newCall(request);
List<Share.data.record> records111 = null;
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d("11111111", "onfailure");
// List<Share.data.record> records111 = null;
// return records111;
}
@Override
public void onResponse(Call call, final Response response) throws IOException {
if (true) {
int a = response.code();
b = response.body().string();
Log.d("11111111",b);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d("7777777111111","12123132132");
Gson gson = new Gson();
Share userJson = gson.fromJson(b, Share.class);
Log.d("yuyuyuyuyu", String.valueOf(userJson.getData().getTotal()));
if (Integer.valueOf(userJson.getData().getTotal())==0){
}else {
Log.d("KONG",userJson.getData().getTotal());
list = userJson.getData().getRecord();
Log.d("aaaa",String.valueOf(list));
mAdapter = new WaterfallAdapter(getActivity(), list);
mAdapter.test();
// if (mAdapter == null){
// Log.d("22222222","33333333");
// }else {
//
// }
mRecyclerView.setAdapter(mAdapter);
// QQQ = userJson.getCode();
// Log.d("7777777",QQQ);
}
}
});
} else {
}
}
});
}
private void initView(){
/*************************控件初始化*****************************/
imgdetail = view.findViewById(R.id.cd_home_item);
/*************************************************************/
// list = new ArrayList<>();
/**************************设置回收视图、瀑布流布局***************************/
mRecyclerView = view.findViewById(R.id.Rv_home);
mRecyclerView.setHasFixedSize(true);
mlayoutmanager = new StaggeredGridLayoutManager(1, StaggeredGridLayoutManager.VERTICAL);
// 页面布局为1列纵向分布
mRecyclerView.setLayoutManager(mlayoutmanager);
/********************************************************************/
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}

@ -0,0 +1,19 @@
package com.example.picture_sharing.ui.home;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class HomeViewModel extends ViewModel {
private final MutableLiveData<String> mText;
public HomeViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is home fragment");
}
public LiveData<String> getText() {
return mText;
}
}

@ -0,0 +1,247 @@
package com.example.picture_sharing.ui.personal;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.example.picture_sharing.Login.LoginActivity;
import com.example.picture_sharing.MainActivity;
import com.example.picture_sharing.Mine_Recycleview.Mine;
import com.example.picture_sharing.Person_RecycleView.CollectionAdapter;
import com.example.picture_sharing.Person_RecycleView.MyCollection;
import com.example.picture_sharing.R;
import com.example.picture_sharing.SQL.Collection;
import com.example.picture_sharing.SQL.User;
import com.google.gson.Gson;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;
import cn.bmob.v3.listener.UpdateListener;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class PersonalFragment extends Fragment implements View.OnClickListener {
private PersonalViewModel personViewModel;
private int RESULT_OK = -1;
private View view;
public static ImageView imageView;
public TextView username;
public TextView userid;
private Intent intent;
public static Uri himguri;
public static int uid;
public static String name;
public List<User> list;
public static List<MyCollection> ALLlistcollect;
public static List<MyCollection> listcollect;
public static RecyclerView pRecyclerView;
public static RecyclerView.LayoutManager playoutmanager;
public static CollectionAdapter pAdapter;
public MyCollection myCollection;
public User user;
public String huri;
public int myaccountnumber;
public User user1;
private Intent intent1;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
personViewModel =
new ViewModelProvider(this).get(PersonalViewModel.class);
view = inflater.inflate(R.layout.fragment_personal, container, false);
initview();
showCollcetion();
return view;
}
public void selectheadportrait(){
try {
/*********************选择图片**************************/
intent1=new Intent();
intent1.setType("image/*");
//action表示intent的类型可以是查看、删除、发布或其他情况
// 选择ACTION_GET_CONTENT系统可以根据Type类型来调用系统程序选择Type
//由上,选择图片
intent1.setAction(Intent.ACTION_PICK);
//如果第二个参数大于或等于0那么当用户操作完成后会返回到本程序的onActivityResult方法
startActivityForResult(intent1,2);
/*****************************************************/
}catch (SecurityException e){
e.printStackTrace();
}
}
public void initview(){
imageView = view.findViewById(R.id.person_headportrait);
username = view.findViewById(R.id.person_name);
userid = view.findViewById(R.id.person_id);
imageView.setOnClickListener(this);
listcollect = new ArrayList<>();
ALLlistcollect = new ArrayList<>();
pRecyclerView = view.findViewById(R.id.Rv_person);
// 绑定收藏recle分栏界面
pRecyclerView.setHasFixedSize(true);
// 保留图片adapter的高度宽度
playoutmanager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
pRecyclerView.setLayoutManager(playoutmanager);
username.setText(LoginActivity.mname);
userid.setText(LoginActivity.UserId);
if(MainActivity.myh!=null){
imageView.setImageResource(R.drawable.touxiang);
}
else imageView.setImageResource(R.drawable.touxiang);
}
public void onClick(View view){
switch (view.getId()){
case R.id.person_headportrait:
selectheadportrait();
break;
case R.id.person_name:
break;
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 0x2 && resultCode == RESULT_OK) {
if (data != null) {
himguri = data.getData();
}
}
imageView.setImageResource(R.drawable.touxiang);
user1 = new User();
user1.sethUri(String.valueOf(himguri));
user1.update(MainActivity.obj,new UpdateListener() {
@Override
public void done(BmobException e) {
}
});
}
public void showCollcetion(){
// 用来放置adapter的图片CollectionAdapter
// BmobQuery<MyCollection> myCollectionBmobQuery = new BmobQuery<>();
// myCollectionBmobQuery.addWhereEqualTo("userId",Integer.valueOf(MainActivity.UserId));
// myCollectionBmobQuery.findObjects(new FindListener<MyCollection>() {
// @Override
// public void done(List<MyCollection> list, BmobException e) {
// if(list!=null){
// listcollect = list;
// pAdapter = new CollectionAdapter(getActivity(),listcollect);
// pRecyclerView.setAdapter(pAdapter);
// }
//
// }
// });
final String TAG ="MainActivity";
RequestBody requestBody = new FormBody.Builder() //(post使用)
.add("fileList","D:/admfafin/asdfasdf")
.build();
String url = "http://47.107.52.7:88/member/photo/collect?current=1&size=99&userId="+MainActivity.Zuseridcode;
OkHttpClient okHttpClient = new OkHttpClient();
final Request request = new Request.Builder()
.url(url)
.addHeader("appId",MainActivity.appId)
.addHeader("appSecret",MainActivity.appSecret)
// .post(requestBody)
.get()
.build();
Call call = okHttpClient.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d("1111111111","onfailure"); //在Logcat中查看日志
}
//请求失败执行
@Override
public void onResponse(Call call,final Response response) throws IOException {
if (true){
Log.d(TAG, response.protocol() + " " +response.code() + " " + response.message());
final String b = response.body().string(); //完整的body
Log.d("jieguo",response.message());
// if (response.message()==null){
//
// }else {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Gson gson = new Gson(); //解析
Collection userJson = gson.fromJson(b, Collection.class);
Log.d("JIE","1"+userJson.getMsg());
if (userJson.getData()==null){}
else {
int A = userJson.getCode();
Log.d("00000000", Integer.toString(A));
for (int i = 0; i < userJson.getData().getRecords().size(); i++) {
myCollection = new MyCollection(
1, //username---userid
Integer.parseInt(userJson.getData().getRecords().get(i).getId()), //id-----shareid
// userJson.getData().getRecords().get(i).getPUserId(),
userJson.getData().getRecords().get(i).getId(), //userid----sharename
userJson.getData().getRecords().get(i).getImageUrlList().get(0), //图片做头像
Integer.parseInt(userJson.getData().getRecords().get(i).getId()), //id---iteamid
userJson.getData().getRecords().get(i).getImageUrlList().get(0), //图片
userJson.getData().getRecords().get(i).getTitle(), //标题
userJson.getData().getRecords().get(i).getContent(), //内容
500
);
listcollect.add(myCollection);
}
pAdapter = new CollectionAdapter(getActivity(), listcollect);
pRecyclerView.setAdapter(pAdapter);
}
}
});
}
}
});
}
}

@ -0,0 +1,18 @@
package com.example.picture_sharing.ui.personal;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class PersonalViewModel extends ViewModel {
private final MutableLiveData<String> mText;
public PersonalViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is personal fragment");
}
public LiveData<String> getText() {
return mText;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<solid android:color="@android:color/transparent"/>
<stroke android:width="1dp"
android:color="@color/whitesmoke"/>
</shape>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<solid android:color="@color/whitesmoke"/>
</shape>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<solid android:color="@color/white"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M19.77,5.03l1.4,1.4L8.43,19.17l-5.6,-5.6 1.4,-1.4 4.2,4.2L19.77,5.03m0,-2.83L8.43,13.54l-4.2,-4.2L0,13.57 8.43,22 24,6.43 19.77,2.2z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M1,21h4L5,9L1,9v12zM23,10c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.59,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-2z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z"/>
</vector>

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF000000"
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 矩形的圆角弧度 -->
<corners android:radius="200dp" />
<!-- 矩形的填充色 -->
<solid android:color="#3F51B5" />
<!-- 矩形的边框的宽度,每段虚线的长度,和两段虚线之间的颜色和颜色 -->
<stroke
android:width="1dp"
android:color="#4eb621"
android:dashGap="4dp"
android:dashWidth="8dp" />
<gradient
android:startColor="@color/honeydew"
android:endColor="@color/teal_200"
android:type="linear"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="#009688"
android:endColor="#00695C"
android:startColor="#4DB6AC"
android:type="linear" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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=".publish.CreateMyPhotoActivity"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="400dp">
<EditText
android:id="@+id/et_gettitle"
android:layout_width="490dp"
android:layout_height="90dp"
android:layout_marginLeft="5dp"
android:hint="标题" />
<EditText
android:id="@+id/et_getdetail"
android:layout_width="490dp"
android:layout_height="82dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="100dp"
android:hint="内容" />
<Button
android:id="@+id/bt_determine"
android:layout_width="169dp"
android:layout_height="75dp"
android:layout_marginStart="220dp"
android:layout_marginTop="260dp"
android:background="@drawable/roundbutton"
android:onClick="onClick"
android:text="发布" />
<Button
android:id="@+id/bt_cancel"
android:layout_width="169dp"
android:layout_height="75dp"
android:layout_marginStart="25dp"
android:layout_marginLeft="50dp"
android:layout_marginTop="260dp"
android:background="@drawable/roundbutton"
android:onClick="onClick"
android:text="取消" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/addmImage"
android:layout_width="match_parent"
android:layout_height="300dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_baseline_person_24" />
</RelativeLayout>
</LinearLayout>

@ -0,0 +1,178 @@
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="130dp">
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/imageView"
android:layout_width="261dp"
android:layout_height="210dp"
android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/tubiao" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="102dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_width="415dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:text="Picture-Sharing"
android:textColor="@color/purple_500"
android:textSize="30dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="50dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/textView2"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center_vertical"
android:text="账号"
android:textSize="16sp" />
<EditText
android:id="@+id/userName"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="50dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/textView"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center_vertical"
android:text="密码"
android:textSize="16sp" />
<EditText
android:id="@+id/userPassword"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="50dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/checkBox"
android:layout_width="269dp"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/PasswordVisibleImage"
android:layout_width="36dp"
android:layout_height="32dp"
android:layout_below="@+id/PasswordText"
android:layout_alignParentEnd="true"
android:onClick="@onClick"
android:src="@drawable/ic_baseline_visibility_off_24" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="20dp">
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="50dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/loginButton"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:gravity="center_horizontal|center_vertical"
android:text="登录"
android:background="@drawable/roundbutton"
android:textAlignment="center"
android:textSize="16sp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="68dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/registerButton"
android:layout_width="120dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:gravity="center_horizontal|center_vertical"
android:text="注册"
android:background="@drawable/roundbutton"
/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
android:id="@+id/app_bar_main"
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>

@ -0,0 +1,172 @@
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="55dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_width="297dp"
android:layout_height="123dp"
android:layout_gravity="center_vertical"
android:text="欢迎注册"
android:textColor="#3AC5B8"
android:textSize="70dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="50dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/run"
android:layout_width="81dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center_vertical"
android:text="账 号:"
android:textSize="16sp"
tools:layout_editor_absoluteX="53dp"
tools:layout_editor_absoluteY="199dp" />
<EditText
android:id="@+id/ruserName"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入你的账号"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="119dp"
tools:layout_editor_absoluteY="187dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="50dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/rup1"
android:layout_width="81dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center_vertical"
android:text="密 码:"
android:textSize="16sp"
tools:layout_editor_absoluteX="53dp"
tools:layout_editor_absoluteY="199dp" />
<EditText
android:id="@+id/ruserPassword"
android:layout_width="247dp"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入你的密码"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="119dp"
tools:layout_editor_absoluteY="187dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="50dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/rup2"
android:layout_width="79dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center_vertical"
android:text="确认密码:"
android:textSize="16sp"
tools:layout_editor_absoluteX="53dp"
tools:layout_editor_absoluteY="199dp" />
<EditText
android:id="@+id/ruserPassword1"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请再次输入你的密码"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="119dp"
tools:layout_editor_absoluteY="187dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="85dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/register"
android:layout_width="5dp"
android:layout_height="match_parent"
android:layout_weight="@integer/config_navAnimTime"
android:text="注册"></Button>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="70dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/cancel"
android:layout_width="11dp"
android:layout_height="wrap_content"
android:layout_weight="@integer/config_navAnimTime"
android:text="取消"></Button>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="70dp"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.PictureSharing.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.PictureSharing.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
<ImageView
android:id="@+id/fabu"
android:layout_width="70dp"
android:layout_height="83dp"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="16dp"
android:background="@drawable/ic_baseline_add_circle_outline_24" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".Home_ItemActivity"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/r1"
android:layout_width="match_parent"
android:layout_alignParentTop="true"
android:layout_height="60dp"
android:background="@color/wheat">
<ImageView
android:id="@+id/img_back_home"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:onClick="onClick"
android:src="@drawable/home_back" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/r2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/r1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/wheat"
>
<ImageView
android:id="@+id/ig_myshareimage"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/tv_home_item_title"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_below="@+id/ig_myshareimage"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:textColor="@color/black"
android:textSize="18sp"
/>
<TextView
android:id="@+id/tv_home_item_detail"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_below="@id/tv_home_item_title"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:textColor="@color/black"
android:textSize="12sp" />
<TextView
android:id="@+id/home_item_commentscount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_home_item_detail"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:textSize="20sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_home_item_commentlist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/home_item_commentscount"
android:layout_marginLeft="15dp" />
<TextView
android:id="@+id/end"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/rv_home_item_commentlist"
android:gravity="center"
android:text="-The End-" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_alignParentBottom="true"
android:background="@color/wheat">
<EditText
android:id="@+id/home_item_Entercomments"
android:layout_width="160dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:background="@drawable/edittext_shape"
android:gravity="center"
android:hint="请输入内容" />
<ImageView
android:id="@+id/ig_home_item_collect"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="340dp"
android:layout_marginTop="20dp"
android:onClick="onClick"
android:src="@drawable/shouchang" />
<Button
android:id="@+id/Comment"
android:layout_width="110dp"
android:layout_height="50dp"
android:layout_marginLeft="220dp"
android:layout_marginTop="10dp"
android:background="@drawable/roundbutton"
android:onClick="onClick"
android:text="发表评论" />
</RelativeLayout>
</RelativeLayout>

@ -0,0 +1,20 @@
<?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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main">
<fragment
android:id="@+id/nav_host_fragment_content_main"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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=".ui.home.HomeFragment"
android:orientation="vertical"
android:background="#F7F9FD"
android:descendantFocusability="blocksDescendants"
>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/Rv_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F7F9FD"
android:scrollbars="none"></androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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"
android:orientation="vertical"
tools:context=".ui.personal.PersonalFragment"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="197dp">
<ImageView
android:id="@+id/person_headportrait"
android:layout_width="91dp"
android:layout_height="82dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:onClick="onClick"
android:src="@drawable/touxiang" />
<TextView
android:id="@+id/person_name"
android:layout_width="214dp"
android:layout_height="41dp"
android:layout_alignTop="@+id/person_headportrait"
android:layout_marginStart="110dp"
android:layout_marginTop="1dp"
android:gravity="center"
android:onClick="onClick"
android:text="个人中心"
android:textColor="@color/black"
android:textSize="20sp" />
<TextView
android:id="@+id/person_id"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_alignBottom="@+id/person_headportrait"
android:layout_marginStart="165dp"
android:textSize="15sp" />
<TextView
android:layout_width="50dp"
android:layout_height="35dp"
android:layout_alignBottom="@+id/person_headportrait"
android:layout_marginStart="110dp"
android:text="账号:"
android:textSize="15sp" />
<TextView
android:id="@+id/personal_data"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_alignLeft="@+id/person_headportrait"
android:layout_marginLeft="2dp"
android:layout_marginTop="120dp"
android:gravity="center"
android:hint="这个人很懒,什么都没有留下" />
<TextView
android:layout_width="50dp"
android:layout_height="35dp"
android:text="" />
<TextView
android:id="@+id/person_concern_count"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_alignStart="@id/person_headportrait"
android:layout_marginTop="160dp" />
<TextView
android:id="@+id/person_fans_count"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_marginStart="70dp"
android:layout_marginTop="160dp" />
<TextView
android:id="@+id/person_collection_count"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_marginStart="150dp"
android:layout_marginTop="160dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F7F9FD"
>
<TextView
android:id="@+id/schj"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:background="@drawable/edittext_shape"
android:gravity="center"
android:text="我的收藏"
android:textSize="30sp"
/>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/schj">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/Rv_person"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F7F9FD"
android:scrollbars="none"></androidx.recyclerview.widget.RecyclerView>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
</LinearLayout>

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="80dp"
android:layout_height="80dp"
android:contentDescription="@string/nav_header_desc"
android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@drawable/touxiang" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
</LinearLayout>

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F7F9FD"
android:orientation="vertical"
android:padding="1.8dp">
<androidx.cardview.widget.CardView
android:id="@+id/cd_home_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F7F9FD"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="10dp"
android:orientation="vertical"
android:background="@color/azure"
>
<ImageView
android:id="@+id/ig_home_item_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/honeydew"
android:src="@drawable/ic_baseline_delete_24" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_shareimage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/mytitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:textColor="@color/black"
android:textSize="16sp" />
<ImageView
android:id="@+id/h_item_sharerig"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="@+id/mytitle" />
<TextView
android:id="@+id/h_item_sharername"
android:layout_width="60dp"
android:layout_height="20dp"
android:layout_below="@+id/mytitle"
android:layout_centerInParent="true"
android:textSize="15sp" />
<ImageView
android:id="@+id/love_selected"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="@+id/mytitle"
android:layout_toRightOf="@id/h_item_sharername"
android:src="@drawable/ic_baseline_thumb_up_24" />
<TextView
android:id="@+id/count"
android:layout_width="160dp"
android:layout_height="30dp"
android:layout_below="@+id/mytitle"
android:layout_toRightOf="@id/love_selected"
android:textSize="20sp" />
</RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp">
<ImageView
android:id="@+id/comment_userimg"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="5dp"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/comment_username"
android:layout_width="250dp"
android:layout_height="30dp"
android:layout_marginLeft="60dp" />
<TextView
android:id="@+id/comment_usercomment"
android:layout_width="280dp"
android:layout_height="60dp"
android:layout_below="@+id/comment_username"
android:layout_marginLeft="60dp" />
</RelativeLayout>
</LinearLayout>

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="25dp">
<ImageView
android:id="@+id/m_hImg"
android:layout_width="30dp"
android:layout_height="30dp"
/>
<TextView
android:id="@+id/m_Name"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_toRightOf="@+id/m_hImg"
android:background="@drawable/edittext_shape1"
android:gravity="center"
android:textColor="@color/teal_200"
android:textSize="15sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/r"
android:layout_width="230dp"
android:layout_height="200dp"
android:layout_marginStart="90dp"
android:background="@drawable/edittext_shape2">
<TextView
android:id="@+id/m_Title"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="7dp"
android:layout_marginLeft="7dp"
android:layout_marginTop="7dp"
android:layout_marginEnd="145dp"
android:layout_marginBottom="7dp"
android:textColor="@color/black"
android:textSize="15sp" />
<ImageView
android:id="@+id/m_Pic"
android:layout_width="200dp"
android:layout_height="160dp"
android:layout_below="@+id/m_Title"
android:layout_alignLeft="@+id/m_Title"
android:scaleType="centerCrop" />
<TextView
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_below="@+id/m_Pic" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_below="@+id/r">
</RelativeLayout>
</RelativeLayout>

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F7F9FD"
android:orientation="vertical"
android:padding="1.8dp"
>
<androidx.cardview.widget.CardView
android:id="@+id/cd_person_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F7F9FD"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="10dp"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_person_shareimage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/collection_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="16sp" />
<ImageView
android:id="@+id/p_sharerhimg"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="@id/collection_title" />
<TextView
android:id="@+id/p_shareName"
android:layout_width="60dp"
android:layout_height="20dp"
android:layout_below="@id/collection_title"
android:layout_toRightOf="@+id/p_sharerhimg"
android:textSize="15sp"
/>
<ImageView
android:id="@+id/person_love_selected"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="@+id/collection_title"
android:layout_marginStart="100dp"
android:src="@drawable/love2" />
<TextView
android:id="@+id/person_count"
android:layout_width="160dp"
android:layout_height="30dp"
android:layout_below="@+id/collection_title"
android:layout_marginStart="130dp"
android:textSize="20sp" />
</RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_home"
android:icon="@drawable/ic_baseline_home_24"
android:title="@string/menu_home" />
<item
android:id="@+id/nav_personal"
android:icon="@drawable/ic_baseline_person_24"
android:title="@string/menu_personal" />
</group>
</menu>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
</menu>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_background" />
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_background" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation 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:id="@+id/mobile_navigation"
app:startDestination="@+id/nav_home">
<fragment
android:id="@+id/nav_home"
android:name="com.example.picture_sharing.ui.home.HomeFragment"
android:label="@string/menu_home"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/nav_personal"
android:name="com.example.picture_sharing.ui.personal.PersonalFragment"
android:label="@string/menu_personal"
tools:layout="@layout/fragment_personal" />
</navigation>

@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">48dp</dimen>
</resources>

@ -0,0 +1,16 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.PictureSharing" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">200dp</dimen>
</resources>

@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">48dp</dimen>
</resources>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="sex">
<item></item>
<item></item>
</string-array>
</resources>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#87BDBD</color>
<color name="purple_500">#49DAB8</color>
<color name="purple_700">#109E99</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="azure">#F3E7E6</color>
<color name="honeydew">#37D626</color>
<color name="whitesmoke">#F3E0DF</color>
<color name="lightpink">#F4EBEB</color>
<color name="lightskyblue">#F4E7E6</color>
<color name="aquamarine">#F8E9E7</color>
<color name="aliceblue">#FAEDEC</color>
<color name="wheat">#EBDAD9</color>
<color name="colorAccent">#8FA295</color>
</resources>

@ -0,0 +1,8 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>

@ -0,0 +1,17 @@
<resources>
<string name="app_name">Picture-Sharing</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">Android Studio</string>
<string name="nav_header_subtitle">android.studio@android.com</string>
<string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string>
<string name="menu_home">主页</string>
<string name="menu_personal">个人中心</string>
<string name="shared_preferences_file_name">sp_login</string >
<string name="login_account_name">login_account_name</string >
<string name="login_password">login_password</string >
<string name="login_remember_password">login_remember_password</string>
</resources>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save