mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-28 03:42:16 -05:00
Introduce NavigationDrawer, Migrate to AppCompatTheme, Replace ActionBar with Toolbar.
This commit is contained in:
parent
deaf1c4679
commit
74ae710f22
@ -23,7 +23,8 @@ dependencies {
|
|||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
compile 'com.android.support:support-v4:22.0.0'
|
compile 'com.android.support:support-v4:22.0.0'
|
||||||
compile 'com.android.support:cardview-v7:22.0.0'
|
compile 'com.android.support:cardview-v7:22.0.0'
|
||||||
compile "com.android.support:recyclerview-v7:22.0.0"
|
compile 'com.android.support:recyclerview-v7:22.0.0'
|
||||||
|
compile 'com.android.support:appcompat-v7:22.0.0'
|
||||||
|
|
||||||
compile 'com.viewpagerindicator:library:2.4.1@aar'
|
compile 'com.viewpagerindicator:library:2.4.1@aar'
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
Yaaic - Yet Another Android IRC Client
|
Yaaic - Yet Another Android IRC Client
|
||||||
|
|
||||||
Copyright 2009-2013 Sebastian Kaspari
|
Copyright 2009-2015 Sebastian Kaspari
|
||||||
|
|
||||||
This file is part of Yaaic.
|
This file is part of Yaaic.
|
||||||
|
|
||||||
@ -20,8 +20,6 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
*/
|
*/
|
||||||
package org.yaaic.activity;
|
package org.yaaic.activity;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
@ -37,6 +35,8 @@ import android.os.Handler;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.speech.RecognizerIntent;
|
import android.speech.RecognizerIntent;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.text.method.TextKeyListener;
|
import android.text.method.TextKeyListener;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@ -86,7 +86,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author Sebastian Kaspari <sebastian@yaaic.org>
|
* @author Sebastian Kaspari <sebastian@yaaic.org>
|
||||||
*/
|
*/
|
||||||
public class ConversationActivity extends Activity implements ServiceConnection, ServerListener, ConversationListener
|
public class ConversationActivity extends ActionBarActivity implements ServiceConnection, ServerListener, ConversationListener
|
||||||
{
|
{
|
||||||
public static final int REQUEST_CODE_SPEECH = 99;
|
public static final int REQUEST_CODE_SPEECH = 99;
|
||||||
|
|
||||||
@ -187,13 +187,15 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
|||||||
this.finish();
|
this.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionBar actionBar = getActionBar();
|
|
||||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
|
||||||
actionBar.setElevation(0);
|
|
||||||
|
|
||||||
setTitle(server.getTitle());
|
setTitle(server.getTitle());
|
||||||
|
|
||||||
setContentView(R.layout.conversations);
|
setContentView(R.layout.activity_conversations);
|
||||||
|
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
toolbar.setElevation(0);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
boolean isLandscape = (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE);
|
boolean isLandscape = (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||||
|
|
||||||
@ -411,12 +413,8 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* On menu item selected
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemSelected(int featureId, MenuItem item)
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
{
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
finish();
|
finish();
|
||||||
|
@ -18,14 +18,18 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.yaaic.activity;
|
package org.yaaic.a ctivity;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
import android.support.v4.widget.DrawerLayout;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import org.yaaic.R;
|
import org.yaaic.R;
|
||||||
import org.yaaic.fragment.OverviewFragment;
|
import org.yaaic.fragment.OverviewFragment;
|
||||||
@ -38,7 +42,8 @@ import org.yaaic.model.Status;
|
|||||||
/**
|
/**
|
||||||
* The main activity of Yaaic. We'll add, remove and replace fragments here.
|
* The main activity of Yaaic. We'll add, remove and replace fragments here.
|
||||||
*/
|
*/
|
||||||
public class MainActivity extends Activity implements OverviewFragment.Callback, ServiceConnection {
|
public class MainActivity extends ActionBarActivity implements OverviewFragment.Callback, ServiceConnection {
|
||||||
|
private ActionBarDrawerToggle toggle;
|
||||||
private IRCBinder binder;
|
private IRCBinder binder;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -46,6 +51,21 @@ public class MainActivity extends Activity implements OverviewFragment.Callback,
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer);
|
||||||
|
toggle = new ActionBarDrawerToggle(this, drawer, toolbar, 0, 0);
|
||||||
|
|
||||||
|
drawer.setDrawerListener(toggle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
|
super.onPostCreate(savedInstanceState);
|
||||||
|
|
||||||
|
toggle.syncState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -70,6 +90,15 @@ public class MainActivity extends Activity implements OverviewFragment.Callback,
|
|||||||
unbindService(this);
|
unbindService(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (toggle.onOptionsItemSelected(item)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onServerSelected(Server server) {
|
public void onServerSelected(Server server) {
|
||||||
Intent intent = new Intent(this, ConversationActivity.class);
|
Intent intent = new Intent(this, ConversationActivity.class);
|
||||||
|
142
app/src/main/java/org/yaaic/view/ScrimInsetsFrameLayout.java
Normal file
142
app/src/main/java/org/yaaic/view/ScrimInsetsFrameLayout.java
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
package org.yaaic.view;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2014 Google Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.support.v4.view.ViewCompat;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
import org.yaaic.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A layout that draws something in the insets passed to {@link #fitSystemWindows(Rect)}, i.e. the area above UI chrome
|
||||||
|
* (status and navigation bars, overlay action bars).
|
||||||
|
*/
|
||||||
|
public class ScrimInsetsFrameLayout extends FrameLayout {
|
||||||
|
private Drawable mInsetForeground;
|
||||||
|
|
||||||
|
private Rect mInsets;
|
||||||
|
private Rect mTempRect = new Rect();
|
||||||
|
private OnInsetsCallback mOnInsetsCallback;
|
||||||
|
|
||||||
|
public ScrimInsetsFrameLayout(Context context) {
|
||||||
|
super(context);
|
||||||
|
init(context, null, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScrimInsetsFrameLayout(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
init(context, attrs, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScrimInsetsFrameLayout(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
init(context, attrs, defStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
final TypedArray a = context.obtainStyledAttributes(attrs,
|
||||||
|
R.styleable.ScrimInsetsView, defStyle, 0);
|
||||||
|
if (a == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mInsetForeground = a.getDrawable(R.styleable.ScrimInsetsView_insetForeground);
|
||||||
|
a.recycle();
|
||||||
|
|
||||||
|
setWillNotDraw(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean fitSystemWindows(Rect insets) {
|
||||||
|
mInsets = new Rect(insets);
|
||||||
|
setWillNotDraw(mInsetForeground == null);
|
||||||
|
ViewCompat.postInvalidateOnAnimation(this);
|
||||||
|
if (mOnInsetsCallback != null) {
|
||||||
|
mOnInsetsCallback.onInsetsChanged(insets);
|
||||||
|
}
|
||||||
|
return true; // consume insets
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Canvas canvas) {
|
||||||
|
super.draw(canvas);
|
||||||
|
|
||||||
|
int width = getWidth();
|
||||||
|
int height = getHeight();
|
||||||
|
if (mInsets != null && mInsetForeground != null) {
|
||||||
|
int sc = canvas.save();
|
||||||
|
canvas.translate(getScrollX(), getScrollY());
|
||||||
|
|
||||||
|
// Top
|
||||||
|
mTempRect.set(0, 0, width, mInsets.top);
|
||||||
|
mInsetForeground.setBounds(mTempRect);
|
||||||
|
mInsetForeground.draw(canvas);
|
||||||
|
|
||||||
|
// Bottom
|
||||||
|
mTempRect.set(0, height - mInsets.bottom, width, height);
|
||||||
|
mInsetForeground.setBounds(mTempRect);
|
||||||
|
mInsetForeground.draw(canvas);
|
||||||
|
|
||||||
|
// Left
|
||||||
|
mTempRect.set(0, mInsets.top, mInsets.left, height - mInsets.bottom);
|
||||||
|
mInsetForeground.setBounds(mTempRect);
|
||||||
|
mInsetForeground.draw(canvas);
|
||||||
|
|
||||||
|
// Right
|
||||||
|
mTempRect.set(width - mInsets.right, mInsets.top, width, height - mInsets.bottom);
|
||||||
|
mInsetForeground.setBounds(mTempRect);
|
||||||
|
mInsetForeground.draw(canvas);
|
||||||
|
|
||||||
|
canvas.restoreToCount(sc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow();
|
||||||
|
if (mInsetForeground != null) {
|
||||||
|
mInsetForeground.setCallback(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow();
|
||||||
|
if (mInsetForeground != null) {
|
||||||
|
mInsetForeground.setCallback(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows the calling container to specify a callback for custom processing when insets change (i.e. when
|
||||||
|
* {@link #fitSystemWindows(Rect)} is called. This is useful for setting padding on UI elements based on
|
||||||
|
* UI chrome insets (e.g. a Google Map or a ListView). When using with ListView or GridView, remember to set
|
||||||
|
* clipToPadding to false.
|
||||||
|
*/
|
||||||
|
public void setOnInsetsCallback(OnInsetsCallback onInsetsCallback) {
|
||||||
|
mOnInsetsCallback = onInsetsCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static interface OnInsetsCallback {
|
||||||
|
public void onInsetsChanged(Rect insets);
|
||||||
|
}
|
||||||
|
}
|
74
app/src/main/res/layout/activity_conversations.xml
Normal file
74
app/src/main/res/layout/activity_conversations.xml
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Yaaic - Yet Another Android IRC Client
|
||||||
|
|
||||||
|
Copyright 2009-2015 Sebastian Kaspari
|
||||||
|
|
||||||
|
This file is part of Yaaic.
|
||||||
|
|
||||||
|
Yaaic is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
Yaaic is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/drawer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/item_toolbar" />
|
||||||
|
|
||||||
|
<org.yaaic.view.ConversationTabLayout
|
||||||
|
android:id="@+id/indicator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/primary" />
|
||||||
|
|
||||||
|
<android.support.v4.view.ViewPager
|
||||||
|
android:id="@+id/pager"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_margin="0px"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:padding="0dp"
|
||||||
|
android:unselectedAlpha="100" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/input"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:imeOptions="actionSend"
|
||||||
|
android:inputType="textImeMultiLine" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/speech"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@android:drawable/ic_btn_speak_now"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/item_drawer" />
|
||||||
|
|
||||||
|
</android.support.v4.widget.DrawerLayout>
|
@ -1,10 +1,51 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<!--
|
||||||
|
Yaaic - Yet Another Android IRC Client
|
||||||
|
|
||||||
|
Copyright 2009-2015 Sebastian Kaspari
|
||||||
|
|
||||||
|
This file is part of Yaaic.
|
||||||
|
|
||||||
|
Yaaic is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
Yaaic is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/drawer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/container">
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/chrome"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/item_toolbar" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
|
android:name="org.yaaic.fragment.OverviewFragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent" />
|
||||||
android:name="org.yaaic.fragment.OverviewFragment" />
|
</FrameLayout>
|
||||||
</FrameLayout>
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/item_drawer" />
|
||||||
|
|
||||||
|
</android.support.v4.widget.DrawerLayout>
|
@ -1,59 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Yaaic - Yet Another Android IRC Client
|
|
||||||
|
|
||||||
Copyright 2009-2013 Sebastian Kaspari
|
|
||||||
|
|
||||||
This file is part of Yaaic.
|
|
||||||
|
|
||||||
Yaaic is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
Yaaic is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
-->
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent">
|
|
||||||
<org.yaaic.view.ConversationTabLayout
|
|
||||||
android:id="@+id/indicator"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@color/primary"
|
|
||||||
android:elevation="4dp" />
|
|
||||||
<android.support.v4.view.ViewPager
|
|
||||||
android:id="@+id/pager"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_margin="0px"
|
|
||||||
android:unselectedAlpha="100"
|
|
||||||
android:padding="0dp" />
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/input"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:inputType="textImeMultiLine"
|
|
||||||
android:imeOptions="actionSend" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/speech"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:drawableLeft="@android:drawable/ic_btn_speak_now"
|
|
||||||
android:visibility="gone" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
30
app/src/main/res/layout/item_drawer.xml
Normal file
30
app/src/main/res/layout/item_drawer.xml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Yaaic - Yet Another Android IRC Client
|
||||||
|
|
||||||
|
Copyright 2009-2015 Sebastian Kaspari
|
||||||
|
|
||||||
|
This file is part of Yaaic.
|
||||||
|
|
||||||
|
Yaaic is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
Yaaic is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<org.yaaic.view.ScrimInsetsFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="start"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:clickable="true"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
app:insetForeground="#4000" />
|
32
app/src/main/res/layout/item_toolbar.xml
Normal file
32
app/src/main/res/layout/item_toolbar.xml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Yaaic - Yet Another Android IRC Client
|
||||||
|
|
||||||
|
Copyright 2009-2015 Sebastian Kaspari
|
||||||
|
|
||||||
|
This file is part of Yaaic.
|
||||||
|
|
||||||
|
Yaaic is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
Yaaic is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/primary"
|
||||||
|
android:minHeight="?attr/actionBarSize"
|
||||||
|
android:elevation="8dp"
|
||||||
|
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||||
|
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
|
5
app/src/main/res/values/attrs.xml
Normal file
5
app/src/main/res/values/attrs.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<resources>
|
||||||
|
<declare-styleable name="ScrimInsetsView">
|
||||||
|
<attr name="insetForeground" format="reference|color" />
|
||||||
|
</declare-styleable>
|
||||||
|
</resources>
|
@ -1,11 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="Theme.Yaaic" parent="android:Theme.Material.Light.DarkActionBar">
|
<style name="Theme.Yaaic" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="android:colorPrimary">@color/primary</item>
|
<item name="colorPrimary">@color/primary</item>
|
||||||
<item name="android:colorPrimaryDark">@color/primary_dark</item>
|
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||||
<item name="android:colorAccent">@color/accent</item>
|
<item name="colorAccent">@color/accent</item>
|
||||||
|
<item name="colorControlHighlight">@color/control_highlight</item>
|
||||||
|
|
||||||
<item name="android:windowBackground">@color/window_background</item>
|
<item name="android:windowBackground">@color/window_background</item>
|
||||||
<item name="android:colorControlHighlight">@color/control_highlight</item>
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="FloatingActionButton" parent="android:Widget.Material.Button">
|
<style name="FloatingActionButton" parent="android:Widget.Material.Button">
|
||||||
|
Loading…
Reference in New Issue
Block a user