Skip to content

Commit

Permalink
refactor(UI):rename ui file name
Browse files Browse the repository at this point in the history
  • Loading branch information
ZCShou committed Oct 15, 2022
1 parent 676bddc commit e3ae319
Show file tree
Hide file tree
Showing 11 changed files with 629 additions and 619 deletions.
20 changes: 14 additions & 6 deletions app/src/main/java/com/zcshou/gogogo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public boolean onMenuItemActionExpand(MenuItem item) {
SimpleAdapter simAdapt = new SimpleAdapter(
MainActivity.this,
data,
R.layout.search_record_item,
R.layout.search_item,
new String[] {DataBaseHistorySearch.DB_COLUMN_KEY,
DataBaseHistorySearch.DB_COLUMN_DESCRIPTION,
DataBaseHistorySearch.DB_COLUMN_TIMESTAMP,
Expand Down Expand Up @@ -426,6 +426,10 @@ public void onAccuracyChanged(Sensor sensor, int i) {

}

/*
* 导航菜单
* */

private void initNavigationView() {
mNavigationView = findViewById(R.id.nav_view);
mNavigationView.setNavigationItemSelectedListener(item -> {
Expand Down Expand Up @@ -497,6 +501,10 @@ private void initUserInfo() {
}
}

/*
* 导航菜单
* */

private void initSearchView() {
mSearchList = findViewById(R.id.search_list_view);
mSearchLayout = findViewById(R.id.search_linear);
Expand Down Expand Up @@ -609,7 +617,7 @@ private void setSearchHistoryClickListener() {
SimpleAdapter simAdapt = new SimpleAdapter(
MainActivity.this,
data,
R.layout.search_record_item,
R.layout.search_item,
new String[] {DataBaseHistorySearch.DB_COLUMN_KEY,
DataBaseHistorySearch.DB_COLUMN_DESCRIPTION,
DataBaseHistorySearch.DB_COLUMN_TIMESTAMP,
Expand Down Expand Up @@ -660,7 +668,7 @@ private void setSearchSuggestListener() {
SimpleAdapter simAdapt = new SimpleAdapter(
MainActivity.this,
data,
R.layout.poi_search_item,
R.layout.search_poi_item,
new String[] {POI_NAME, POI_ADDRESS, POI_LONGITUDE, POI_LATITUDE}, // 与下面数组元素要一一对应
new int[] {R.id.poi_name, R.id.poi_address, R.id.poi_longitude, R.id.poi_latitude});
mSearchList.setAdapter(simAdapt);
Expand All @@ -678,7 +686,7 @@ public void showRegisterDialog() {
if (window != null) {
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
window.setContentView(R.layout.register_dialog);
window.setContentView(R.layout.register);
window.setGravity(Gravity.CENTER);
window.setWindowAnimations(R.style.DialogAnimFadeInFadeOut);

Expand Down Expand Up @@ -800,7 +808,7 @@ private void initBaiduMap() {
mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);
mBaiduMap.setMyLocationEnabled(true);

View poiView = View.inflate(MainActivity.this, R.layout.poi_info, null);
View poiView = View.inflate(MainActivity.this, R.layout.location_poi_info, null);
TextView poiAddress = poiView.findViewById(R.id.poi_address);
TextView poiLongitude = poiView.findViewById(R.id.poi_longitude);
TextView poiLatitude = poiView.findViewById(R.id.poi_latitude);
Expand Down Expand Up @@ -1044,7 +1052,7 @@ private void initListenerMapBtn() {
AlertDialog dialog;
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("请输入经度和纬度");
View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.input_position, null);
View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.location_input, null);
builder.setView(view);
dialog = builder.show();

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zcshou/joystick/JoyStick.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ private void initJoyStickMapView() {
SimpleAdapter simAdapt = new SimpleAdapter(
mContext,
data,
R.layout.poi_search_item,
R.layout.search_poi_item,
new String[] {MainActivity.POI_NAME, MainActivity.POI_ADDRESS, MainActivity.POI_LONGITUDE, MainActivity.POI_LATITUDE}, // 与下面数组元素要一一对应
new int[] {R.id.poi_name, R.id.poi_address, R.id.poi_longitude, R.id.poi_latitude});
mSearchList.setAdapter(simAdapt);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
tools:openDrawer="start">

<include
layout="@layout/app_bar_main"
layout="@layout/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/joystick_button.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?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="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
Expand All @@ -27,7 +28,8 @@
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@null"
android:src="@drawable/ic_up"
android:theme="@style/RippleWhite" />
android:theme="@style/RippleWhite"
tools:ignore="TouchTargetSizeCheck" />

<ImageButton
android:id="@+id/btn_north_east"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,87 +1,87 @@
<?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:orientation="vertical">

<EditText
android:id="@+id/joystick_longitude"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:autofillHints="longitude"
android:hint="@string/label_longitude"
android:inputType="numberDecimal"
android:minHeight="48dp" />

<EditText
android:id="@+id/joystick_latitude"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:autofillHints="latitude"
android:hint="@string/label_latitude"
android:inputType="numberDecimal"
android:minHeight="48dp" />

<RadioGroup
android:id="@+id/RadioGroupMapType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal">

<RadioButton
android:id="@+id/pos_type_bd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="@string/input_position_baidu" />

<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/input_position_gps" />
</RadioGroup>


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:orientation="horizontal">

<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />

<Button
android:id="@+id/input_position_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/input_position_cancel"/>

<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Button
android:id="@+id/input_position_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/input_position_ok"/>

<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />

</LinearLayout>
<?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:orientation="vertical">

<EditText
android:id="@+id/joystick_longitude"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:autofillHints="longitude"
android:hint="@string/label_longitude"
android:inputType="numberDecimal"
android:minHeight="48dp" />

<EditText
android:id="@+id/joystick_latitude"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:autofillHints="latitude"
android:hint="@string/label_latitude"
android:inputType="numberDecimal"
android:minHeight="48dp" />

<RadioGroup
android:id="@+id/RadioGroupMapType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal">

<RadioButton
android:id="@+id/pos_type_bd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="@string/input_position_baidu" />

<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/input_position_gps" />
</RadioGroup>


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:orientation="horizontal">

<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />

<Button
android:id="@+id/input_position_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/input_position_cancel"/>

<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Button
android:id="@+id/input_position_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/input_position_ok"/>

<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />

</LinearLayout>
</LinearLayout>
Loading

0 comments on commit e3ae319

Please sign in to comment.