weizhengliang преди 3 месеца
родител
ревизия
1e27d30a93
променени са 2 файла, в които са добавени 14 реда и са изтрити 0 реда
  1. 3 0
      app/src/main/java/com/inuker/bluetooth/MainActivity.java
  2. 11 0
      app/src/main/res/layout/content_main.xml

+ 3 - 0
app/src/main/java/com/inuker/bluetooth/MainActivity.java

@@ -47,6 +47,7 @@ public class MainActivity extends Activity implements  DeviceListAdapter.OnItemC
     private PullRefreshListView mListView;
     private DeviceListAdapter mAdapter;
     private TextView mTvTitle;
+    private TextView tvVersion;
     private ProgressBar pbar;
 
     private List<SearchResult> mDevices;
@@ -84,6 +85,8 @@ public class MainActivity extends Activity implements  DeviceListAdapter.OnItemC
         mTvTitle = findViewById(R.id.title);
         pbar = findViewById(R.id.mainpbar);
         mRefreshLayout = findViewById(R.id.pulllayout);
+        tvVersion = findViewById(R.id.version);
+        tvVersion.setText("v" + BuildConfig.VERSION_NAME);
 
         mListView = mRefreshLayout.getPullToRefreshListView();
         mAdapter = new DeviceListAdapter(this);

+ 11 - 0
app/src/main/res/layout/content_main.xml

@@ -18,12 +18,23 @@
         android:textSize="20sp"
         android:gravity="center"
         android:layout_alignParentTop="true"/>
+
+    <TextView
+        android:id="@+id/version"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:text="version:--"
+        android:textColor="#000000"
+        android:textSize="16sp"
+        android:gravity="center" />
     
     <com.inuker.bluetooth.view.PullToRefreshFrameLayout
         android:id="@+id/pulllayout"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_below="@id/title"
+        android:layout_above="@+id/version"
         custom:has_header="true"
         custom:has_footer="false"
         custom:has_shadow="false"