Added material colors.

This commit is contained in:
Felix Ableitner 2015-06-24 11:57:39 +02:00
parent da7fd6e5f7
commit 58da843d9b
5 changed files with 29 additions and 13 deletions

View file

@ -5,6 +5,6 @@
<solid android:color="#ffffff"/>
<stroke android:width="1dip" android:color="@color/chat_seperator"/>
<stroke android:width="1dip" android:color="@color/divider"/>
</shape>

View file

@ -4,7 +4,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="10"
android:orientation="vertical">
android:orientation="vertical"
android:background="@color/chat_background">
<FrameLayout
android:layout_height="0dp"
@ -12,8 +13,7 @@
android:layout_weight="11"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_marginBottom="2dip"
android:background="@color/chat_background">
android:layout_marginBottom="2dip">
<ListView
android:id="@android:id/list"
@ -29,7 +29,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@color/chat_seperator"/>
android:background="@color/divider"/>
<LinearLayout
android:layout_height="wrap_content"

View file

@ -2,10 +2,16 @@
<resources>
<!-- Background color for ChatFragment -->
<color name="chat_background">#E6FFE6</color>
<color name="primary">#3F51B5</color>
<color name="primary_dark">#303F9F</color>
<color name="primary_light">#C5CAE9</color>
<color name="accent">#448AFF</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#B6B6B6</color>
<!-- Color for message border and compose/message layout seperator in ChatFragment -->
<color name="chat_seperator">#AAAAAA</color>
<!-- Background color for ChatFragment -->
<color name="chat_background">#f3f2fb</color>
</resources>

View file

@ -2,7 +2,18 @@
<resources>
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar" />
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:alertDialogTheme">@style/AlertDialogTheme</item>
</style>
<style name="AlertDialogTheme" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
</style>
<style name="Translucent" parent="AppTheme">
<item name="android:windowNoTitle">true</item>

View file

@ -35,8 +35,7 @@ class MainActivity extends EnsiChatActivity {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val intent: Intent = new
Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE)
val intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE)
intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0)
startActivityForResult(intent, RequestSetDiscoverable)
@ -97,7 +96,7 @@ class MainActivity extends EnsiChatActivity {
* If in a ChatFragment, goes back up to contactsFragment.
*/
override def onBackPressed(): Unit = {
if (currentChat != None) {
if (currentChat.isDefined) {
getFragmentManager
.beginTransaction()
.remove(getFragmentManager.findFragmentById(android.R.id.content))