This reverts commit 838e39690d.
@ -1,6 +0,0 @@
|
||||
projectKey=Test
|
||||
serverUrl=http://localhost:9000
|
||||
serverVersion=9.9.0.65466
|
||||
dashboardUrl=http://localhost:9000/dashboard?id=Test
|
||||
ceTaskId=AYu0FgJhk-ulwfDUJI5I
|
||||
ceTaskUrl=http://localhost:9000/api/ce/task?id=AYu0FgJhk-ulwfDUJI5I
|
||||
@ -1,23 +0,0 @@
|
||||
package com.example.myapplication.ui.Buttonfragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class HazardGarbageFragment extends Fragment {//有害垃圾介绍
|
||||
|
||||
public HazardGarbageFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.hazard_garbage, container, false);
|
||||
}
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.example.myapplication.ui.Buttonfragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class KitchenGarbageFragment extends Fragment {//厨余垃圾介绍
|
||||
|
||||
public KitchenGarbageFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.kitchen_garbage, container, false);
|
||||
}
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.example.myapplication.ui.Buttonfragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class OtherGarbageFragment extends Fragment {//其他垃圾介绍
|
||||
|
||||
public OtherGarbageFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.other_garbage, container, false);
|
||||
}
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.example.myapplication.ui.Buttonfragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class RecycleGarbageFragment extends Fragment {//可回收垃圾介绍
|
||||
|
||||
public RecycleGarbageFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.recycle_garbage, container, false);
|
||||
}
|
||||
}
|
||||
@ -1,88 +0,0 @@
|
||||
package com.example.myapplication.ui.dashboard;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.databinding.FragmentDashboardBinding;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.tencent.lbssearch.TencentSearch;
|
||||
import com.tencent.lbssearch.httpresponse.HttpResponseListener;
|
||||
import com.tencent.lbssearch.object.param.WalkingParam;
|
||||
import com.tencent.lbssearch.object.result.WalkingResultObject;
|
||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMapInitializer;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TextureMapView;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
|
||||
public class MapActivity extends Fragment {
|
||||
|
||||
private TextureMapView mapView;
|
||||
private FloatingActionButton currentPositioning;
|
||||
private FloatingActionButton nearbyTrashBinChoose;
|
||||
private FloatingActionButton navigation;
|
||||
private FragmentDashboardBinding binding;
|
||||
private MapPositioning controller;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
MapActivityViewModel dashboardViewModel = new ViewModelProvider(this).get(MapActivityViewModel.class);
|
||||
|
||||
TencentMapInitializer.setAgreePrivacy(true);
|
||||
|
||||
binding = FragmentDashboardBinding.inflate(inflater, container, false);
|
||||
|
||||
View root = binding.getRoot();
|
||||
|
||||
mapView = root.findViewById(R.id.mapview);
|
||||
|
||||
currentPositioning = root.findViewById(R.id.Get_Current_Location);
|
||||
|
||||
nearbyTrashBinChoose = root.findViewById(R.id.check_nearby_trash_cans);
|
||||
|
||||
navigation = root.findViewById(R.id.navigiation);
|
||||
|
||||
controller = new MapPositioning(mapView, binding,getActivity());
|
||||
|
||||
currentPositioning.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
controller.onClickCurrentPositioning();
|
||||
}
|
||||
});
|
||||
|
||||
nearbyTrashBinChoose.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
controller.onClickNearbyTrashBinChoose();
|
||||
}
|
||||
});
|
||||
|
||||
navigation.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
controller.onClickNavigation();
|
||||
}
|
||||
});
|
||||
|
||||
controller.startLocationUpdates();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
controller.stopLocationUpdates();
|
||||
mapView.onDestroy();
|
||||
binding = null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.example.myapplication.ui.dashboard;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class MapActivityViewModel extends ViewModel {
|
||||
|
||||
private final MutableLiveData<String> mText;
|
||||
|
||||
public MapActivityViewModel() {
|
||||
mText = new MutableLiveData<>();
|
||||
mText.setValue("This is dashboard fragment");
|
||||
}
|
||||
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
}
|
||||
@ -1,233 +0,0 @@
|
||||
package com.example.myapplication.ui.dashboard;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.example.myapplication.databinding.FragmentDashboardBinding;
|
||||
import com.tencent.lbssearch.TencentSearch;
|
||||
import com.tencent.lbssearch.httpresponse.HttpResponseListener;
|
||||
import com.tencent.lbssearch.object.param.WalkingParam;
|
||||
import com.tencent.lbssearch.object.result.WalkingResultObject;
|
||||
import com.tencent.map.geolocation.TencentLocationManager;
|
||||
import com.tencent.map.geolocation.TencentLocationRequest;
|
||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdate;
|
||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TextureMapView;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLngBounds;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MapPositioning {
|
||||
|
||||
private TextureMapView mapView;
|
||||
private TencentMap tencentMap;
|
||||
private FragmentDashboardBinding binding;
|
||||
|
||||
private List<LatLng> TrashBin;
|
||||
|
||||
private FragmentActivity fragmentActivity;
|
||||
|
||||
static double currentLatitude;
|
||||
|
||||
static double currentLongitude;
|
||||
|
||||
TencentSearch tencentSearch;
|
||||
|
||||
WalkingParam walkingParam;
|
||||
|
||||
LatLng chooseTrashBin;
|
||||
|
||||
public float calculateDistance(LatLng start, LatLng end) {//计算所有标记垃圾桶与当前位置的距离
|
||||
double earthRadius = 6371;
|
||||
|
||||
double lat1 = Math.toRadians(start.getLatitude());
|
||||
|
||||
double lon1 = Math.toRadians(start.getLongitude());
|
||||
|
||||
double lat2 = Math.toRadians(end.getLatitude());
|
||||
|
||||
double lon2 = Math.toRadians(end.getLongitude());
|
||||
|
||||
double deltaLat = lat2 - lat1;
|
||||
|
||||
double deltaLon = lon2 - lon1;
|
||||
|
||||
double a = Math.sin(deltaLat / 2) * Math.sin(deltaLat / 2)
|
||||
+ Math.cos(lat1) * Math.cos(lat2)
|
||||
* Math.sin(deltaLon / 2) * Math.sin(deltaLon / 2);
|
||||
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
|
||||
return (float) (earthRadius * c);
|
||||
}
|
||||
private HttpResponseListener<WalkingResultObject> httpResponseListener;
|
||||
|
||||
public MapPositioning(TextureMapView mapView, FragmentDashboardBinding binding,FragmentActivity activity) {//初始化,
|
||||
this.mapView = mapView;
|
||||
this.binding = binding;
|
||||
tencentMap = mapView.getMap();
|
||||
tencentMap.setMyLocationEnabled(true);
|
||||
tencentMap.enableMultipleInfowindow(true);
|
||||
fragmentActivity=activity;
|
||||
TrashBin=new ArrayList<>();
|
||||
|
||||
TrashBin.add(new LatLng(39.111981,117.350131));//添加垃圾桶位置信息
|
||||
|
||||
TrashBin.add(new LatLng(39.112578,117.349414));
|
||||
|
||||
TrashBin.add(new LatLng(39.112062,117.349687));
|
||||
|
||||
TrashBin.add(new LatLng(39.1162,117.350954));
|
||||
|
||||
TrashBin.add(new LatLng(39.115949,117.351535));
|
||||
|
||||
TrashBin.add(new LatLng(39.115614,117.351487));
|
||||
|
||||
TrashBin.add(new LatLng(39.115767,117.351119));
|
||||
|
||||
tencentSearch=new TencentSearch(mapView.getContext());
|
||||
|
||||
httpResponseListener = new HttpResponseListener<WalkingResultObject>() {
|
||||
@Override
|
||||
public void onSuccess(int i, WalkingResultObject walkingResultObject) {
|
||||
if(walkingParam==null)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
for(WalkingResultObject.Route route:walkingResultObject.result.routes)
|
||||
{
|
||||
List<LatLng> polyline = route.polyline;
|
||||
|
||||
tencentMap.addPolyline(new PolylineOptions().addAll(polyline).width(5f).color(Color.RED));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(int i, String s, Throwable throwable) {
|
||||
|
||||
}
|
||||
};
|
||||
tencentMap.setOnMarkerClickListener(new TencentMap.OnMarkerClickListener() {//根据当前上一次的点击事件,判断是否为双击事件,如果是双击事件就进行导航
|
||||
private long lastClickTime;
|
||||
@Override
|
||||
public boolean onMarkerClick(Marker marker) {
|
||||
long clicktime=System.currentTimeMillis();
|
||||
|
||||
if(clicktime-lastClickTime<1000)
|
||||
{
|
||||
LatLng now = marker.getPosition();
|
||||
|
||||
walkingParam=new WalkingParam(new LatLng(currentLatitude,currentLongitude),now);
|
||||
|
||||
tencentSearch.getRoutePlan(walkingParam, httpResponseListener);
|
||||
}
|
||||
lastClickTime=clicktime;
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onClickCurrentPositioning() {//发送请求,获取当前位置信息
|
||||
String message = "当前位置:纬度:" + currentLatitude + ",经度:" + currentLongitude;
|
||||
|
||||
Toast.makeText(mapView.getContext(), message, Toast.LENGTH_SHORT).show();
|
||||
|
||||
tencentMap.moveCamera(CameraUpdateFactory.newLatLng(new LatLng(currentLatitude,currentLongitude)));
|
||||
}
|
||||
|
||||
public void onClickNearbyTrashBinChoose() {//显示附近的垃圾桶位置信息
|
||||
long st=System.currentTimeMillis();
|
||||
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
||||
|
||||
for(LatLng trashBin:TrashBin)
|
||||
{
|
||||
tencentMap.addMarker(new MarkerOptions(trashBin));
|
||||
}
|
||||
|
||||
builder.include(new LatLng(currentLatitude,currentLongitude));
|
||||
|
||||
for(LatLng trashBin:TrashBin)
|
||||
{
|
||||
builder.include(trashBin);
|
||||
}
|
||||
LatLngBounds bounds = builder.build();
|
||||
|
||||
int padding=100;
|
||||
|
||||
CameraUpdate cameraUpdate=CameraUpdateFactory.newLatLngBounds(bounds,padding);
|
||||
|
||||
tencentMap.moveCamera(cameraUpdate);
|
||||
long ed=System.currentTimeMillis();
|
||||
System.out.println(ed);
|
||||
}
|
||||
|
||||
public void onClickNavigation() {//进行导航功能
|
||||
double shortestDistance=Double.MAX_VALUE;
|
||||
|
||||
LatLng now = new LatLng(currentLatitude, currentLongitude);
|
||||
|
||||
for(LatLng trashBin:TrashBin)//获取所有垃圾桶位置信息并计算距离
|
||||
{
|
||||
double distance=calculateDistance(now,trashBin);
|
||||
|
||||
if(distance<shortestDistance)
|
||||
{
|
||||
shortestDistance=distance;
|
||||
|
||||
chooseTrashBin=trashBin;
|
||||
}
|
||||
}
|
||||
walkingParam = new WalkingParam(now,chooseTrashBin);
|
||||
|
||||
tencentSearch.getRoutePlan(walkingParam,httpResponseListener);
|
||||
|
||||
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
||||
|
||||
builder.include(now);
|
||||
|
||||
builder.include(chooseTrashBin);
|
||||
|
||||
LatLngBounds bounds = builder.build();
|
||||
|
||||
int padding=100;
|
||||
|
||||
CameraUpdate cameraUpdate=CameraUpdateFactory.newLatLngBounds(bounds,padding);
|
||||
|
||||
tencentMap.moveCamera(cameraUpdate);
|
||||
}
|
||||
|
||||
public void startLocationUpdates() {//更新地图位置信息
|
||||
TencentLocationManager mLocationManager=TencentLocationManager.getInstance(fragmentActivity,null);
|
||||
|
||||
mLocationManager.setCoordinateType(TencentLocationManager.COORDINATE_TYPE_GCJ02);
|
||||
|
||||
TencentLocationRequest request= TencentLocationRequest.create();
|
||||
|
||||
request.setRequestLevel(TencentLocationRequest.REQUEST_LEVEL_ADMIN_AREA);
|
||||
|
||||
MyLocationListener myLocationListener=new MyLocationListener(tencentMap,fragmentActivity);
|
||||
|
||||
request.setInterval(3000);
|
||||
|
||||
mLocationManager.requestLocationUpdates(request,myLocationListener,TencentLocationRequest.REQUEST_LEVEL_GEO);
|
||||
}
|
||||
|
||||
public void stopLocationUpdates() {//停止地图位置信息控制
|
||||
TencentLocationManager mLocationManager=TencentLocationManager.getInstance(fragmentActivity,null);
|
||||
|
||||
MyLocationListener myLocationListener=new MyLocationListener(tencentMap,fragmentActivity);
|
||||
|
||||
mLocationManager.removeUpdates(myLocationListener);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,133 +0,0 @@
|
||||
package com.example.myapplication.ui.dashboard;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.view.Surface;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.tencent.map.geolocation.TencentLocation;
|
||||
import com.tencent.map.geolocation.TencentLocationListener;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMapNavi;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
|
||||
|
||||
public class MyLocationListener implements TencentLocationListener, SensorEventListener {
|
||||
private final int TIME_SENSOR = 10;
|
||||
private TencentMap tencentMap;
|
||||
private Marker marker;
|
||||
private FragmentActivity activity;
|
||||
private long lastTime;
|
||||
private static float mAngle;
|
||||
|
||||
private Sensor orientationSensor;
|
||||
private SensorManager sensorManager;
|
||||
|
||||
public MyLocationListener(TencentMap tencentMap, FragmentActivity activity) {
|
||||
this.tencentMap = tencentMap;
|
||||
this.activity = activity;
|
||||
this.lastTime = System.currentTimeMillis();
|
||||
sensorManager = (SensorManager) activity.getSystemService(Context.SENSOR_SERVICE);
|
||||
orientationSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
|
||||
sensorManager.registerListener(this, orientationSensor, SensorManager.SENSOR_DELAY_NORMAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(TencentLocation location, int error, String reason) {//发送请求
|
||||
if (error == TencentLocation.ERROR_OK) {
|
||||
// 定位成功
|
||||
double latitude = location.getLatitude();
|
||||
double longitude = location.getLongitude();
|
||||
MapPositioning.currentLatitude=latitude;
|
||||
MapPositioning.currentLongitude=longitude;
|
||||
Log.d("latitude", "onLocationChanged: "+latitude);
|
||||
Log.d("longitude","onLocationChanged"+longitude);
|
||||
LatLng latLng = new LatLng(latitude, longitude);
|
||||
|
||||
if (marker != null) {
|
||||
marker.remove(); // 清除之前的标记
|
||||
}
|
||||
marker = tencentMap.addMarker(new MarkerOptions(latLng));
|
||||
marker.setRotation(mAngle);// 自定义标记图标
|
||||
} else {
|
||||
// 处理定位失败的情况
|
||||
Toast.makeText(activity, "定位失败:" + reason, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusUpdate(String name, int status, String desc) {
|
||||
// 处理位置提供者状态变化的情况
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGnssInfoChanged(Object o) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNmeaMsgChanged(String s) {
|
||||
|
||||
}
|
||||
|
||||
public static int getScreenRotationOnPhone(Context context) {//获取手机的角度信息
|
||||
final Display display = ((WindowManager) context
|
||||
.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
|
||||
|
||||
switch (display.getRotation()) {
|
||||
case Surface.ROTATION_0:
|
||||
return 0;
|
||||
|
||||
case Surface.ROTATION_90:
|
||||
return 90;
|
||||
|
||||
case Surface.ROTATION_180:
|
||||
return 180;
|
||||
|
||||
case Surface.ROTATION_270:
|
||||
return -90;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSensorChanged(SensorEvent event) {//获取当前手机的方向
|
||||
if (System.currentTimeMillis() - lastTime < TIME_SENSOR) {
|
||||
return;
|
||||
}
|
||||
switch (event.sensor.getType()) {
|
||||
case Sensor.TYPE_ORIENTATION: {
|
||||
float x = event.values[0];
|
||||
x += getScreenRotationOnPhone(activity);
|
||||
x %= 360.0F;
|
||||
if (x > 180.0F)
|
||||
x -= 360.0F;
|
||||
else if (x < -180.0F)
|
||||
x += 360.0F;
|
||||
|
||||
if (Math.abs(mAngle - x) < 3.0f) {
|
||||
break;
|
||||
}
|
||||
mAngle = Float.isNaN(x) ? 0 : x;
|
||||
if (marker != null) {
|
||||
marker.setRotation(mAngle);
|
||||
}
|
||||
lastTime = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package com.example.myapplication.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.myapplication.BottomNavigiationActivity;
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.ui.home.GarbageRecognitionActivity;
|
||||
|
||||
public class index extends AppCompatActivity {
|
||||
|
||||
private static final long SPLASH_DELAY = 800; // 延迟时间,单位为毫秒,启动界面
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.getSupportActionBar().hide();
|
||||
// 设置启动页布局文件
|
||||
setContentView(R.layout.launch_screen);
|
||||
|
||||
// 延迟跳转到主界面
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Intent intent = new Intent(index.this, BottomNavigiationActivity.class);
|
||||
startActivity(intent);
|
||||
finish(); // 销毁当前活动,防止用户返回到启动页
|
||||
}
|
||||
}, SPLASH_DELAY);
|
||||
}
|
||||
}
|
||||
@ -1,125 +0,0 @@
|
||||
package com.example.myapplication.ui.notifications;
|
||||
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
public class FeedbackUploader {//反馈信息与后端进行交互
|
||||
public static void submitFeedback(UserFeedbackActivity userFeedbackActivity, String imagePath,String additionalString) {
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(1);
|
||||
Toast toast = new Toast(userFeedbackActivity.getActivity());
|
||||
Future<Void> uploadTask = executorService.submit(() -> {
|
||||
try {
|
||||
Log.d("s2","t1");
|
||||
String uploadImageUrl = "http://192.168.203.243:5000/upload_image"; // 替换为图片上传的URL
|
||||
String uploadStringUrl = "http://192.168.203.243:5000/upload_text"; // 替换为字符串上传的URL
|
||||
Log.d("s2","t2");
|
||||
File imageFile = new File(imagePath);
|
||||
if (!imageFile.exists()) {
|
||||
Log.d("s2","t3");
|
||||
System.out.println("Image file not found.");
|
||||
return null;
|
||||
}
|
||||
Log.d("s2","t1");
|
||||
// 发送图片
|
||||
URL imageUrl = new URL(uploadImageUrl);
|
||||
HttpURLConnection imageConnection = (HttpURLConnection) imageUrl.openConnection();
|
||||
imageConnection.setRequestMethod("POST");
|
||||
imageConnection.setDoOutput(true);
|
||||
|
||||
// 构建请求体
|
||||
String boundary = "*****";
|
||||
String lineEnd = "\r\n";
|
||||
String twoHyphens = "--";
|
||||
|
||||
imageConnection.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary);
|
||||
|
||||
DataOutputStream imageDos = new DataOutputStream(imageConnection.getOutputStream());
|
||||
imageDos.writeBytes(twoHyphens + boundary + lineEnd);
|
||||
imageDos.writeBytes("Content-Disposition: form-data; name=\"file\";filename=\"" + imageFile.getName() + "\"" + lineEnd);
|
||||
imageDos.writeBytes("Content-Type: image/jpeg" + lineEnd);
|
||||
imageDos.writeBytes(lineEnd);
|
||||
|
||||
FileInputStream imageInputStream = new FileInputStream(imageFile);
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = imageInputStream.read(buffer)) != -1) {
|
||||
imageDos.write(buffer, 0, bytesRead);
|
||||
}
|
||||
imageDos.writeBytes(lineEnd);
|
||||
imageDos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);
|
||||
Log.d("s2","t1");
|
||||
// 发送图片请求并获取响应
|
||||
int imageResponseCode = imageConnection.getResponseCode();
|
||||
if (imageResponseCode == HttpURLConnection.HTTP_OK) {
|
||||
// 图片上传成功
|
||||
// System.out.println("Image uploaded successfully.");
|
||||
InputStream inputStream = imageConnection.getInputStream();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
|
||||
String line;
|
||||
line=reader.readLine();
|
||||
|
||||
inputStream.close();
|
||||
Log.d("s2","t2");
|
||||
// 发送字符串
|
||||
URL urlString = new URL(uploadStringUrl);
|
||||
HttpURLConnection stringConnection = (HttpURLConnection) urlString.openConnection();
|
||||
stringConnection.setRequestMethod("POST");
|
||||
stringConnection.setDoOutput(true);
|
||||
stringConnection.setRequestProperty("Content-Type", "text/plain");
|
||||
|
||||
OutputStream stringOs = stringConnection.getOutputStream();
|
||||
stringOs.write(additionalString.getBytes("UTF-8"));
|
||||
stringOs.flush();
|
||||
stringOs.close();
|
||||
// 获取字符串上传响应
|
||||
int stringResponseCode = stringConnection.getResponseCode();
|
||||
if (stringResponseCode == HttpURLConnection.HTTP_OK) {
|
||||
Log.d("s2","t3");
|
||||
// 字符串上传成功
|
||||
InputStream inputStream2 = stringConnection.getInputStream();
|
||||
BufferedReader reader2 = new BufferedReader(new InputStreamReader(inputStream2));
|
||||
while ((line = reader2.readLine()) != null) {
|
||||
System.out.println(line);
|
||||
}
|
||||
inputStream2.close();
|
||||
toast.setText("图片上传成功!");
|
||||
} else {
|
||||
toast.setText("图片上传失败");
|
||||
// 字符串上传失败
|
||||
System.out.println("String upload failed with response code: " + stringResponseCode);
|
||||
}
|
||||
} else {
|
||||
// 图片上传失败
|
||||
toast.setText("图片上传失败");
|
||||
System.out.println("Image upload failed with response code: " + imageResponseCode);
|
||||
}
|
||||
imageInputStream.close();
|
||||
imageDos.flush();
|
||||
imageDos.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
toast.show();
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
// 等待上传任务完成
|
||||
try {
|
||||
uploadTask.get();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 关闭线程池
|
||||
executorService.shutdown();
|
||||
}
|
||||
}
|
||||
@ -1,124 +0,0 @@
|
||||
package com.example.myapplication.ui.notifications;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.databinding.FragmentNotificationsBinding;
|
||||
import com.example.myapplication.ui.home.ImageUploader;
|
||||
import com.google.android.material.checkbox.MaterialCheckBox;
|
||||
|
||||
public class UserFeedbackActivity extends Fragment {
|
||||
|
||||
private FragmentNotificationsBinding binding;
|
||||
|
||||
private ImageButton buttonSelectImage;
|
||||
|
||||
public EditText editText;
|
||||
private Button submit,reset;
|
||||
|
||||
private UserFeedback userFeedback;
|
||||
|
||||
private Uri uri;
|
||||
|
||||
public MaterialCheckBox userExperience,identifyDeviations,functionalRecommendations,classificationExpansion,otherIssues,positiveRecommendation;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
UserFeedbackViewModel notificationsViewModel =
|
||||
new ViewModelProvider(this).get(UserFeedbackViewModel.class);
|
||||
userFeedback = new UserFeedback(this);
|
||||
binding = FragmentNotificationsBinding.inflate(inflater, container, false);
|
||||
View root = binding.getRoot();
|
||||
editText = root.findViewById(R.id.input_feedback);
|
||||
buttonSelectImage = root.findViewById(R.id.btn_select_image);
|
||||
userExperience=root.findViewById(R.id.user_experience);
|
||||
identifyDeviations=root.findViewById(R.id.identify_deviations);
|
||||
functionalRecommendations = root.findViewById(R.id.functional_recommendations);
|
||||
classificationExpansion = root.findViewById(R.id.classification_expansion);
|
||||
otherIssues = root.findViewById(R.id.other_issues);
|
||||
positiveRecommendation = root.findViewById(R.id.positive_recommendation);
|
||||
submit = root.findViewById(R.id.submit);
|
||||
reset = root.findViewById(R.id.reset);
|
||||
editText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
editText.setCursorVisible(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
if(editable != null&& editable.toString().length()>0)
|
||||
{
|
||||
editText.setCursorVisible(true);
|
||||
editText.setGravity(Gravity.START);
|
||||
}
|
||||
else
|
||||
{
|
||||
editText.setGravity(Gravity.CENTER);
|
||||
}
|
||||
}
|
||||
});
|
||||
buttonSelectImage.setOnClickListener(new View.OnClickListener() {//跳转到相册界面
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(Intent.ACTION_PICK,null);
|
||||
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,"image/*");
|
||||
startActivityForResult(intent,2);
|
||||
}
|
||||
});
|
||||
submit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
userFeedback.submitFeedback(uri);
|
||||
}
|
||||
});
|
||||
reset.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
userFeedback.resetAll();
|
||||
}
|
||||
});
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {//获取用户选择的相册的图片
|
||||
if(resultCode==-1)
|
||||
{
|
||||
if(data!=null)
|
||||
{
|
||||
uri = data.getData();
|
||||
buttonSelectImage.setImageURI(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.example.myapplication.ui.notifications;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class UserFeedbackViewModel extends ViewModel {
|
||||
|
||||
private final MutableLiveData<String> mText;
|
||||
|
||||
public UserFeedbackViewModel() {
|
||||
mText = new MutableLiveData<>();
|
||||
mText.setValue("This is notifications fragment");
|
||||
}
|
||||
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
}
|
||||
@ -1,94 +0,0 @@
|
||||
package com.example.myapplication.ui.quiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.databinding.GarbageQuizBinding;
|
||||
import com.example.myapplication.ui.home.GarbageRecognition;
|
||||
import com.example.myapplication.ui.home.GarbageRecognitionActivityViewModel;
|
||||
import com.example.myapplication.ui.notifications.UserFeedbackViewModel;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GarbageQuizActivity extends Fragment {
|
||||
private GarbageQuizBinding binding;
|
||||
public Button aButton,bButton,cButton,dButton;
|
||||
private ImageButton preQuestionButton,nextQuestionButton;
|
||||
|
||||
private GarbageQuiz garbageQuiz;
|
||||
|
||||
public TextView question,analysisTextView;
|
||||
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
com.example.myapplication.ui.newthing.GarbageQuizViewModel notificationsViewModel =
|
||||
new ViewModelProvider(this).get(com.example.myapplication.ui.newthing.GarbageQuizViewModel.class);
|
||||
binding = GarbageQuizBinding.inflate(inflater,container,false);
|
||||
View root = binding.getRoot();
|
||||
aButton = root.findViewById(R.id.a_option);
|
||||
bButton = root.findViewById(R.id.b_option);
|
||||
cButton = root.findViewById(R.id.c_option);
|
||||
dButton = root.findViewById(R.id.d_option);
|
||||
question = root.findViewById(R.id.question);
|
||||
analysisTextView = root.findViewById(R.id.analysisTextView);
|
||||
preQuestionButton = root.findViewById(R.id.pre_question);
|
||||
nextQuestionButton = root.findViewById(R.id.next_question);
|
||||
try {
|
||||
garbageQuiz =new GarbageQuiz(this);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
aButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
garbageQuiz.chooseAOption();
|
||||
}
|
||||
});
|
||||
bButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
garbageQuiz.chooseBOption();
|
||||
}
|
||||
});
|
||||
cButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
garbageQuiz.chooseCOption();
|
||||
}
|
||||
});
|
||||
dButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
garbageQuiz.chooseDOption();
|
||||
}
|
||||
});
|
||||
preQuestionButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
garbageQuiz.getLastQuestion();
|
||||
}
|
||||
});
|
||||
nextQuestionButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
garbageQuiz.getNextQuestion();
|
||||
}
|
||||
});
|
||||
nextQuestionButton.performClick();
|
||||
return root;
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.example.myapplication.ui.newthing;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class GarbageQuizViewModel extends ViewModel {
|
||||
|
||||
private MutableLiveData<String> mText;
|
||||
|
||||
public GarbageQuizViewModel() {
|
||||
mText = new MutableLiveData<>();
|
||||
mText.setValue("This is new fragment");//根据自己喜欢放界面的测试文字
|
||||
}
|
||||
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
sonar-scanner.bat -D"sonar.projectKey=tsq" -D"sonar.sources=User" -D"sonar.host.url=http://localhost:9000" -D"sonar.login=sqp_cfe53f4667e9c83129469f7a698d2f74f5ef73ad"
|
||||
@ -1,30 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 82 KiB |
@ -1,4 +0,0 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:color="@color/blue" />
|
||||
<item android:color="@color/grey"/>
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@ -1,4 +0,0 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="23dp"/> <!-- 设置圆角半径,根据需要调整数值 -->
|
||||
<solid android:color="@color/white"></solid>
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 368 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 82 KiB |
@ -1,9 +0,0 @@
|
||||
<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="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
|
||||
</vector>
|
||||
@ -1,9 +0,0 @@
|
||||
<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="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
|
||||
</vector>
|
||||
@ -1,170 +0,0 @@
|
||||
<?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>
|
||||
@ -1,9 +0,0 @@
|
||||
<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,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 151 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 122 KiB |
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle"
|
||||
>
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 222 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 29 KiB |
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:left="-4dp"
|
||||
android:right="-4dp"
|
||||
android:top="-4dp">
|
||||
<shape>
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="#078EFA" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:left="-4dp"
|
||||
android:right="-4dp"
|
||||
android:top="-4dp">
|
||||
<shape>
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="#F68D2C" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:left="-4dp"
|
||||
android:right="-4dp"
|
||||
android:top="-4dp">
|
||||
<shape android:layout_height="match_parent">
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="#3C927D" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:left="-4dp"
|
||||
android:right="-4dp"
|
||||
android:top="-4dp">
|
||||
<shape>
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="#D92D25" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:top="-2dp" android:left="-2dp" android:right="-2dp" android:bottom="-24dp">
|
||||
<shape
|
||||
android:layout_height="match_parent"
|
||||
android:shape="line">
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:alpha="0.8"
|
||||
android:color="#78078EFA" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="-16dp" android:left="-14dp" android:right="-4dp" android:bottom="-27dp">
|
||||
<shape android:shape="line">
|
||||
<stroke
|
||||
android:width="5dp"
|
||||
android:height="30dp"
|
||||
android:color="#78078EFA"
|
||||
android:alpha="0.6" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="-16dp" android:left="-14dp" android:right="-4dp" android:bottom="-30dp">
|
||||
<shape android:shape="line">
|
||||
<stroke
|
||||
android:width="7dp"
|
||||
android:color="#78078EFA"
|
||||
android:alpha="0.4" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:color="@color/black"
|
||||
android:width="1dp"
|
||||
/>
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
@ -1,5 +0,0 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/image_upload" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/image_upload" android:state_focused="true"/>
|
||||
<item android:drawable="@drawable/image_upload"/>
|
||||
</selector>
|
||||
@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:background="?android:attr/windowBackground"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:menu="@menu/bottom_nav_menu" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_host_fragment_bottom_navigiation"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:defaultNavHost="true"
|
||||
app:iconTint="@null"
|
||||
app:layout_constraintBottom_toTopOf="@id/nav_view"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navGraph="@navigation/mobile_navigation" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="match_parent">
|
||||
<ImageView
|
||||
android:id="@+id/show_photo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/recapture"
|
||||
android:backgroundTint="@color/white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:src="@drawable/camera"
|
||||
android:layout_marginLeft="100dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:text="重新拍摄"
|
||||
/>
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/transmit"
|
||||
android:backgroundTint="@color/white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:background="@drawable/button"
|
||||
android:src="@drawable/upload"
|
||||
android:layout_marginRight="100dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="上传图片"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="match_parent">
|
||||
<ImageView
|
||||
android:id="@+id/user_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/confirm_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/user_confirm"
|
||||
android:layout_marginBottom="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="100dp"-->
|
||||
<!-- android:layout_height="100dp"-->
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/surfaceView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/take_photo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/camera"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.home.GarbageRecognitionActivity">
|
||||
<com.tencent.tencentmap.mapsdk.maps.TextureMapView
|
||||
android:id="@+id/mapview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/navigiation"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginBottom="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/go"
|
||||
android:backgroundTint="@color/white"
|
||||
/>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/check_nearby_trash_cans"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/navigiation"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/near_trash_bin"
|
||||
android:backgroundTint="@color/white"
|
||||
/>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/Get_Current_Location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/check_nearby_trash_cans"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/my_location"
|
||||
android:backgroundTint="@color/white"
|
||||
/>
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.home.GarbageRecognitionActivity">
|
||||
<ImageButton
|
||||
android:layout_marginTop="8dp"
|
||||
android:id="@id/recycle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/recycle"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintWidth_percent="0.25"
|
||||
app:layout_constraintHeight_percent="0.05"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/recycle_text"
|
||||
android:background="@drawable/button"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/recycle_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="可回收垃圾"
|
||||
app:layout_constraintStart_toStartOf="@id/recycle"
|
||||
app:layout_constraintEnd_toEndOf="@id/recycle"
|
||||
app:layout_constraintTop_toBottomOf="@id/recycle"
|
||||
android:gravity="center" />
|
||||
<ImageButton
|
||||
android:layout_marginTop="8dp"
|
||||
android:id="@id/kitchen_garbage"
|
||||
android:src="@drawable/kitchen_garbage"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintWidth_percent="0.25"
|
||||
app:layout_constraintHeight_percent="0.05"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/button"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/kitchen_text"
|
||||
app:layout_constraintLeft_toRightOf="@id/recycle"/>
|
||||
<TextView
|
||||
android:id="@+id/kitchen_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="厨余垃圾"
|
||||
app:layout_constraintStart_toStartOf="@id/kitchen_garbage"
|
||||
app:layout_constraintEnd_toEndOf="@id/kitchen_garbage"
|
||||
app:layout_constraintTop_toBottomOf="@id/kitchen_garbage"
|
||||
android:gravity="center" />
|
||||
<ImageButton
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintWidth_percent="0.25"
|
||||
app:layout_constraintHeight_percent="0.05"
|
||||
android:scaleType="centerInside"
|
||||
android:id="@id/other_garbage"
|
||||
android:src="@drawable/other_garbage"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/button"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/other_garbage_text"
|
||||
app:layout_constraintLeft_toRightOf="@id/kitchen_garbage"/>
|
||||
<TextView
|
||||
android:id="@+id/other_garbage_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="其他垃圾"
|
||||
app:layout_constraintStart_toStartOf="@id/other_garbage"
|
||||
app:layout_constraintEnd_toEndOf="@id/other_garbage"
|
||||
app:layout_constraintTop_toBottomOf="@id/other_garbage"
|
||||
android:gravity="center" />
|
||||
<ImageButton
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintWidth_percent="0.25"
|
||||
app:layout_constraintHeight_percent="0.05"
|
||||
android:scaleType="centerInside"
|
||||
android:id="@id/hazardous_waste"
|
||||
android:src="@drawable/hazardous_waste"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/button"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/hazardous_waste_text"
|
||||
app:layout_constraintLeft_toRightOf="@id/other_garbage"/>
|
||||
<TextView
|
||||
android:id="@+id/hazardous_waste_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="有害垃圾"
|
||||
app:layout_constraintStart_toStartOf="@id/hazardous_waste"
|
||||
app:layout_constraintEnd_toEndOf="@id/hazardous_waste"
|
||||
app:layout_constraintTop_toBottomOf="@id/hazardous_waste"
|
||||
android:gravity="center" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/content_container"
|
||||
android:layout_width="417dp"
|
||||
android:layout_height="400dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@android:color/transparent"
|
||||
app:layout_constraintBottom_toTopOf="@id/capture"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/hazardous_waste_text"
|
||||
app:layout_constraintVertical_bias="0.5"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/capture"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="@drawable/circle_button"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/capture_photo"
|
||||
app:layout_constraintHorizontal_bias="0.488"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_container"></ImageButton>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,210 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".BottomNavigiationActivity"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<!-- 图标和文本的 LinearLayout -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="用户反馈"
|
||||
android:textSize="27sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="30dp"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="190dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/text_underline4"
|
||||
android:gravity="center"
|
||||
android:text="请选择反馈类型:"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/user_experience"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="用户体验"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/identify_deviations"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="识别偏差"
|
||||
tools:ignore="DuplicateIds" />
|
||||
<TextView
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/functional_recommendations"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="功能建议"
|
||||
tools:ignore="DuplicateIds" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/classification_expansion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="分类扩充"
|
||||
tools:ignore="DuplicateIds" />
|
||||
<TextView
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/other_issues"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="其他问题"
|
||||
tools:ignore="DuplicateIds" />
|
||||
<TextView
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/positive_recommendation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="好评推荐"
|
||||
tools:ignore="DuplicateIds" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="30dp"
|
||||
>
|
||||
<TextView
|
||||
android:layout_width="190dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="请详细补充反馈:"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/text_underline4"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
>
|
||||
<EditText
|
||||
android:id="@+id/input_feedback"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="在此处输入反馈"
|
||||
android:gravity="center"
|
||||
android:maxLength="150"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="30dp"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="上传图片:"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/text_underline4"
|
||||
/>
|
||||
|
||||
|
||||
<!--替换图片-->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 此处添加图片-->
|
||||
<ImageButton
|
||||
android:id="@+id/btn_select_image"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:background="@drawable/your_image"
|
||||
android:text="选择图片"
|
||||
android:layout_marginLeft="30dp"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<Button
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="60dp"
|
||||
android:text="提交"
|
||||
tools:ignore="DuplicateIds" />
|
||||
<TextView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
<Button
|
||||
android:id="@+id/reset"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="60dp"
|
||||
android:text="重置"
|
||||
tools:ignore="DuplicateIds" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,156 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".BottomNavigiationActivity"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/grey1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="垃圾知识问答"
|
||||
android:textSize="27sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/question"
|
||||
android:layout_width="360dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/analysisTextView"
|
||||
android:layout_width="360dp"
|
||||
android:layout_height="190dp"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<Button
|
||||
android:textColor="@color/black"
|
||||
android:backgroundTint="@color/white"
|
||||
android:id="@+id/a_option"
|
||||
android:layout_width="155dp"
|
||||
android:layout_height="125dp"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="DuplicateIds" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:textColor="@color/black"
|
||||
android:backgroundTint="@color/white"
|
||||
android:id="@+id/b_option"
|
||||
android:layout_width="155dp"
|
||||
android:layout_height="125dp"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="DuplicateIds" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<Button
|
||||
android:textColor="@color/black"
|
||||
android:backgroundTint="@color/white"
|
||||
android:id="@+id/c_option"
|
||||
android:layout_width="155dp"
|
||||
android:layout_height="125dp"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="DuplicateIds" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:textColor="@color/black"
|
||||
android:id="@+id/d_option"
|
||||
android:layout_width="155dp"
|
||||
android:layout_height="125dp"
|
||||
android:backgroundTint="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="DuplicateIds" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="100dp"
|
||||
android:gravity="center"
|
||||
>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/pre_question"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:background="@drawable/previous_question"
|
||||
tools:ignore="DuplicateIds" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/next_question"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
|
||||
android:background="@drawable/next_question"
|
||||
tools:ignore="DuplicateIds" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@ -1,16 +0,0 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="#F0F2F1"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:src="@drawable/launch_logo"
|
||||
android:background="#F0F2F1"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||