Commit e427377b authored by Grigory Fedorov's avatar Grigory Fedorov

Version added to navigation drawer top right corner.

parent 5a8888d2
...@@ -3,6 +3,8 @@ package com.xabber.android.ui; ...@@ -3,6 +3,8 @@ package com.xabber.android.ui;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
...@@ -12,6 +14,7 @@ import android.view.ViewGroup; ...@@ -12,6 +14,7 @@ import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView;
import com.xabber.android.R; import com.xabber.android.R;
import com.xabber.android.data.Application; import com.xabber.android.data.Application;
...@@ -41,6 +44,14 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL ...@@ -41,6 +44,14 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.contact_list_drawer, container, false); View view = inflater.inflate(R.layout.contact_list_drawer, container, false);
try {
((TextView)view.findViewById(R.id.version))
.setText(getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0)
.versionName);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
View drawerHeader = view.findViewById(R.id.drawer_header); View drawerHeader = view.findViewById(R.id.drawer_header);
drawerHeaderImage = (ImageView) drawerHeader.findViewById(R.id.drawer_header_image); drawerHeaderImage = (ImageView) drawerHeader.findViewById(R.id.drawer_header_image);
...@@ -67,6 +78,8 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL ...@@ -67,6 +78,8 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
divider = footerView.findViewById(R.id.drawer_divider); divider = footerView.findViewById(R.id.drawer_divider);
return view; return view;
} }
......
...@@ -67,6 +67,16 @@ ...@@ -67,6 +67,16 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="1.0.0"
android:id="@+id/version"
android:textColor="@color/grey_300"
android:paddingRight="4dp"
android:textSize="12sp" />
</FrameLayout> </FrameLayout>
<ListView <ListView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment