Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #6 from AiursoftWeb/iui
Browse files Browse the repository at this point in the history
Some ui fixes and improvement
  • Loading branch information
ganlvtech authored May 24, 2019
2 parents abecefe + 7361491 commit f15d5f2
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.MenuItem;
import android.view.View;
import android.widget.*;
import com.ganlvtech.kahlanotify.client.KahlaClient;
Expand Down Expand Up @@ -43,6 +45,7 @@ public class ConversationActivity extends MyServiceActivity {
private ImageButton mButtonSendImage;
private ImageButton mButtonSendFile;
private Button mButtonSend;
private Toolbar mToolbar;
private MessageListItemAdapter mMessageListItemAdapter;
private ConversationListActivitySharedPreferences mConversationListActivitySharedPreferences;
private String mServer;
Expand Down Expand Up @@ -82,6 +85,11 @@ protected void onCreate(Bundle savedInstanceState) {
mButtonSendImage = findViewById(R.id.buttonSendImage);
mButtonSendFile = findViewById(R.id.buttonSendFile);
mButtonSend = findViewById(R.id.buttonSend);
mToolbar = findViewById(R.id.toolbar);

setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(false);

mSwipeRefreshLayout.setColorSchemeColors(getColor(R.color.main_theme));
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
Expand Down Expand Up @@ -352,4 +360,12 @@ private void showImage(IconTitleContent iconTitleContentItem) {
startActivity(intent);
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == android.R.id.home){
onBackPressed();
}
return super.onOptionsItemSelected(item);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.ganlvtech.kahlanotify.kahla.responses.auth.MeResponse;
import com.ganlvtech.kahlanotify.kahla.responses.friendship.MyFriendsResponse;
import com.ganlvtech.kahlanotify.util.ConversationListActivitySharedPreferences;
import com.jaeger.library.StatusBarUtil;

import java.util.List;

Expand Down Expand Up @@ -56,10 +57,12 @@ protected void onCreate(Bundle savedInstanceState) {
mTextViewNewAccount = findViewById(R.id.textViewNewAccount);
mToolbar = findViewById(R.id.toolbar);

StatusBarUtil.setColorNoTranslucentForDrawerLayout(this, mDrawerLayoutConversationListActivity, getColor(R.color.main_theme));

setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_menu_black_24dp);
getSupportActionBar().setDisplayShowTitleEnabled(false);

mDrawerToggle = new ActionBarDrawerToggle(this,mDrawerLayoutConversationListActivity,R.string.Menu,R.string.Menu);
mDrawerLayoutConversationListActivity.addDrawerListener(mDrawerToggle);
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/layout/activity_conversation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:popupTheme="@style/AppTheme._Toolbar"
android:theme="@style/AppTheme._Toolbar"
android:background="@color/main_theme">

<LinearLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center"
android:paddingTop="2dp"
android:paddingBottom="4dp">

Expand Down Expand Up @@ -91,6 +94,8 @@
android:layout_height="wrap_content"
app:icon="@drawable/ic_send_black_24dp"
android:layout_gravity="bottom"
android:layout_marginEnd="4dp"
android:layout_marginStart="4dp"
android:text="@string/send"/>
</LinearLayout>
</LinearLayout>
19 changes: 12 additions & 7 deletions app/src/main/res/layout/activity_conversation_list.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawerLayoutConversationListActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -15,32 +16,36 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:popupTheme="@style/AppTheme._Toolbar"
android:theme="@style/AppTheme._Toolbar"
app:navigationIcon="@drawable/ic_menu_black_24dp"
android:background="@color/main_theme">

<LinearLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="2dp"
android:layout_gravity="center"
android:paddingBottom="4dp">

<TextView
android:id="@+id/toolbarTextViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_gravity="center"
android:text="@string/app_name"
android:textAppearance="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"
android:textColor="@color/toolbar_title" />
android:textColor="@color/toolbar_title"/>

<TextView
android:id="@+id/toolbarTextViewSubtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_gravity="center"
android:textAppearance="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"
android:textColor="@color/toolbar_subtitle"
android:textSize="12sp" />
android:textSize="12sp"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>

Expand All @@ -55,9 +60,9 @@
android:layout_height="match_parent"
android:divider="@android:color/darker_gray"
android:dividerHeight="1px"
android:scrollbars="none" />
android:scrollbars="none"/>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>

<include layout="@layout/drawer_layout_menu" />
<include layout="@layout/drawer_layout_menu"/>
</android.support.v4.widget.DrawerLayout>
5 changes: 4 additions & 1 deletion app/src/main/res/layout/drawer_layout_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@android:color/white"
android:textSize="16sp"
android:text="@string/app_name" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_weight="1"
android:textColor="@android:color/secondary_text_dark"
android:text="@string/version_number"
android:textSize="8sp" />
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<item name="android:statusBarColor">@color/main_theme</item>
</style>

<style name="AppTheme._Toolbar" parent="ThemeOverlay.MaterialComponents.Dark.ActionBar" />

<style name="AppTheme.LoginActivity" parent="AppTheme">
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowSoftInputMode">adjustResize</item>
Expand Down

0 comments on commit f15d5f2

Please sign in to comment.