diff --git a/app/build.gradle b/app/build.gradle index 63a2c2fbd1d30942ce556055a0354857cbe4dee3..efc22453e5c01704ab2739d66094061cf82dcbd1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,6 +2,14 @@ apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt' apply plugin: 'me.tatarka.retrolambda' +dependencies { + repositories { + flatDir { + dirs 'libs' + } + } +} + if (project.hasProperty("storeFile")) { android { signingConfigs { @@ -104,7 +112,7 @@ dependencies { compile 'joda-time:joda-time:2.9.1' compile 'org.joda:joda-convert:1.8' compile 'com.bignerdranch.android:expandablerecyclerview:2.0.4' - compile 'com.sothree.slidinguppanel:library:3.2.1' + compile(name:'asup-release', ext:'aar') compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' @@ -112,8 +120,8 @@ dependencies { compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.android.support:cardview-v7:23.1.1' - compile files('libs/aspm-annotations.jar') - apt files('libs/aspm-compiler.jar') + compile(name:'aspm-annotations', ext:'jar') + apt(name:'aspm-compiler', ext:'jar') compile 'com.jakewharton:butterknife:8.0.0-SNAPSHOT' apt 'com.jakewharton:butterknife-compiler:8.0.0-SNAPSHOT' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1b5240e8daa316fd5801f9f9a7bff99ed4aaafc9..f75ba9a479893a369105fafef47442f5915012b5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,7 +9,6 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true"> - <service android:name=".service.QuasselService" /> <activity @@ -19,10 +18,10 @@ android:theme="@style/AppTheme.Light"> <intent-filter> <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - </application> </manifest> diff --git a/app/src/main/java/de/kuschku/libquassel/Client.java b/app/src/main/java/de/kuschku/libquassel/Client.java index 47831854cf7ebf821deb6af27848059ee0d02341..dc24c9aaeecff2d632390d1ea3e6ad8017cc5c3c 100644 --- a/app/src/main/java/de/kuschku/libquassel/Client.java +++ b/app/src/main/java/de/kuschku/libquassel/Client.java @@ -30,6 +30,7 @@ import de.kuschku.libquassel.primitives.types.QVariant; import de.kuschku.libquassel.syncables.types.BufferSyncer; import de.kuschku.libquassel.syncables.types.BufferViewConfig; import de.kuschku.libquassel.syncables.types.BufferViewManager; +import de.kuschku.libquassel.syncables.types.Identity; import de.kuschku.libquassel.syncables.types.IgnoreListManager; import de.kuschku.libquassel.syncables.types.IrcChannel; import de.kuschku.libquassel.syncables.types.IrcUser; @@ -65,6 +66,7 @@ public class Client { private BufferSyncer bufferSyncer; private ClientData clientData; private IgnoreListManager ignoreListManager; + private Map<Integer, Identity> Identities = new HashMap<>(); public Client(@NonNull final BusProvider busProvider) { this(new SimpleBacklogManager(busProvider), busProvider); @@ -286,4 +288,12 @@ public class Client { public void setIgnoreListManager(IgnoreListManager ignoreListManager) { this.ignoreListManager = ignoreListManager; } + + public void addIdentity(int id, Identity identity) { + Identities.put(id, identity); + } + + public Identity getIdentity(int id) { + return Identities.get(id); + } } diff --git a/app/src/main/java/de/kuschku/libquassel/syncables/types/Identity.java b/app/src/main/java/de/kuschku/libquassel/syncables/types/Identity.java index dc065d33906080a1f87b3f61b68847c12b122ec0..dd43c8f90888858c3b86f48b6fab8a7841471159 100644 --- a/app/src/main/java/de/kuschku/libquassel/syncables/types/Identity.java +++ b/app/src/main/java/de/kuschku/libquassel/syncables/types/Identity.java @@ -259,7 +259,7 @@ public class Identity extends SyncableObject<Identity> { @Override public void init(@NonNull InitDataFunction function, @NonNull BusProvider provider, @NonNull Client client) { - + client.addIdentity(Integer.valueOf(function.objectName), this); } @Override diff --git a/app/src/main/java/de/kuschku/quasseldroid_ng/ui/chat/ChatActivity.java b/app/src/main/java/de/kuschku/quasseldroid_ng/ui/chat/ChatActivity.java index ebc3a279070111659c4cdf2c00766fcb661f95a3..700611bc39eb94b9d6266e989fbdc969e5845d94 100644 --- a/app/src/main/java/de/kuschku/quasseldroid_ng/ui/chat/ChatActivity.java +++ b/app/src/main/java/de/kuschku/quasseldroid_ng/ui/chat/ChatActivity.java @@ -10,23 +10,31 @@ import android.support.annotation.IntRange; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.UiThread; +import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.Snackbar; +import android.support.v4.widget.NestedScrollView; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.ActionMenuView; import android.support.v7.widget.AppCompatEditText; import android.support.v7.widget.AppCompatImageButton; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; +import android.text.method.ScrollingMovementMethod; import android.util.Log; import android.view.View; import android.view.ViewGroup; +import android.widget.ScrollView; +import android.widget.Scroller; import com.afollestad.materialdialogs.MaterialDialog; import com.google.common.base.Splitter; import com.mikepenz.fastadapter.FastAdapter; import com.mikepenz.fastadapter.IExpandable; +import com.mikepenz.fastadapter.IItem; +import com.mikepenz.fastadapter.adapters.ItemAdapter; import com.mikepenz.materialdrawer.AccountHeader; import com.mikepenz.materialdrawer.AccountHeaderBuilder; import com.mikepenz.materialdrawer.Drawer; @@ -34,6 +42,7 @@ import com.mikepenz.materialdrawer.DrawerBuilder; import com.mikepenz.materialdrawer.model.PrimaryDrawerItem; import com.mikepenz.materialdrawer.model.ProfileDrawerItem; import com.mikepenz.materialdrawer.model.SecondaryDrawerItem; +import com.sothree.slidinguppanel.ScrollableViewHelper; import com.sothree.slidinguppanel.SlidingUpPanelLayout; import java.util.Map; @@ -78,6 +87,8 @@ public class ChatActivity extends AppCompatActivity { @Bind(R.id.sliding_layout) SlidingUpPanelLayout slidingLayout; + @Bind(R.id.chatlineScroller) + ScrollView chatlineScroller; @Bind(R.id.chatline) AppCompatEditText chatline; @Bind(R.id.send) @@ -91,6 +102,9 @@ public class ChatActivity extends AppCompatActivity { @Bind(R.id.messages) RecyclerView messages; + @Bind(R.id.amvMenu) + ActionMenuView formattingMenu; + @PreferenceWrapper(BuildConfig.APPLICATION_ID) public static abstract class Settings { @StringPreference("QUASSEL_LIGHT") @@ -216,12 +230,35 @@ public class ChatActivity extends AppCompatActivity { } }); + getMenuInflater().inflate(R.menu.formatting,formattingMenu.getMenu()); + messages.setItemAnimator(new DefaultItemAnimator()); messages.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, true)); messageAdapter = new MessageAdapter(this, context, new AutoScroller(messages)); messages.setAdapter(messageAdapter); - msgHistory.setAdapter(new FastAdapter<>()); + FastAdapter<IItem> fastAdapter = new FastAdapter<>(); + ItemAdapter<IItem> itemAdapter = new ItemAdapter<>(); + itemAdapter.wrap(fastAdapter); + itemAdapter.add( + new PrimaryDrawerItem().withName("Entry #1"), + new PrimaryDrawerItem().withName("Entry #2"), + new PrimaryDrawerItem().withName("Entry #3"), + new PrimaryDrawerItem().withName("Entry #4"), + new PrimaryDrawerItem().withName("Entry #5"), + new PrimaryDrawerItem().withName("Entry #6"), + new PrimaryDrawerItem().withName("Entry #7"), + new PrimaryDrawerItem().withName("Entry #8"), + new PrimaryDrawerItem().withName("Entry #9"), + new PrimaryDrawerItem().withName("Entry #10"), + new PrimaryDrawerItem().withName("Entry #11"), + new PrimaryDrawerItem().withName("Entry #12"), + new PrimaryDrawerItem().withName("Entry #13"), + new PrimaryDrawerItem().withName("Entry #14"), + new PrimaryDrawerItem().withName("Entry #15"), + new PrimaryDrawerItem().withName("Entry #16") + ); + msgHistory.setAdapter(fastAdapter); msgHistory.setLayoutManager(new LinearLayoutManager(this)); msgHistory.setItemAnimator(new DefaultItemAnimator()); @@ -233,6 +270,7 @@ public class ChatActivity extends AppCompatActivity { send.setOnClickListener(view -> sendInput()); + slidingLayout.setAntiDragView(R.id.card_panel); slidingLayout.setPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() { @Override public void onPanelSlide(View panel, float slideOffset) { @@ -241,24 +279,12 @@ public class ChatActivity extends AppCompatActivity { @Override public void onPanelCollapsed(View panel) { - int selectionStart = chatline.getSelectionStart(); - int selectionEnd = chatline.getSelectionEnd(); - - chatline.getLayoutParams().height =context.getThemeUtil().res.actionBarSize; - chatline.setSingleLine(true); - - chatline.setSelection(selectionStart, selectionEnd); + setChatlineExpanded(false); } @Override public void onPanelExpanded(View panel) { - int selectionStart = chatline.getSelectionStart(); - int selectionEnd = chatline.getSelectionEnd(); - - chatline.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT; - chatline.setSingleLine(false); - - chatline.setSelection(selectionStart, selectionEnd); + setChatlineExpanded(true); } @Override @@ -271,6 +297,21 @@ public class ChatActivity extends AppCompatActivity { } }); + setChatlineExpanded(slidingLayout.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED); + } + + public void setChatlineExpanded(boolean expanded) { + int selectionStart = chatline.getSelectionStart(); + int selectionEnd = chatline.getSelectionEnd(); + + if (expanded) { + chatlineScroller.getLayoutParams().height = ViewGroup.LayoutParams.MATCH_PARENT; + } else { + chatlineScroller.getLayoutParams().height = context.getThemeUtil().res.actionBarSize; + } + chatline.setSingleLine(!expanded); + + chatline.setSelection(selectionStart, selectionEnd); } public void showThemeDialog() { diff --git a/app/src/main/res/drawable-hdpi/ic_format_bold_dark.png b/app/src/main/res/drawable-hdpi/ic_format_bold_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..0990216d2ef22cc8da6770cb38939e15fa9263d9 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_bold_dark.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_bold_light.png b/app/src/main/res/drawable-hdpi/ic_format_bold_light.png new file mode 100644 index 0000000000000000000000000000000000000000..2dcb664aef2419b187d37fe5c7e2adf91e4b5ad6 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_bold_light.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_fill_dark.png b/app/src/main/res/drawable-hdpi/ic_format_fill_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..1cf459f319782b66e3c6beccd7b34ea22d561dde Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_fill_dark.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_fill_light.png b/app/src/main/res/drawable-hdpi/ic_format_fill_light.png new file mode 100644 index 0000000000000000000000000000000000000000..edb8ffb3db2ac9b9def5cc29ddff8eca50800cab Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_fill_light.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_italic_dark.png b/app/src/main/res/drawable-hdpi/ic_format_italic_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..e3a092bcec82be561970c5b84c7cfff1a5a3687d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_italic_dark.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_italic_light.png b/app/src/main/res/drawable-hdpi/ic_format_italic_light.png new file mode 100644 index 0000000000000000000000000000000000000000..27e7088ce8bf50decb87561a5d78ddeb92f9978d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_italic_light.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_paint_dark.png b/app/src/main/res/drawable-hdpi/ic_format_paint_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..8531992066bef9b168e0281e9348071825b309a0 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_paint_dark.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_paint_light.png b/app/src/main/res/drawable-hdpi/ic_format_paint_light.png new file mode 100644 index 0000000000000000000000000000000000000000..9bb93297b5de6c2ffba90f7e6d555911171e11f2 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_paint_light.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_underline_dark.png b/app/src/main/res/drawable-hdpi/ic_format_underline_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..8432f789f23156c8d3eb62bbd6885263dd629336 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_underline_dark.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_underline_light.png b/app/src/main/res/drawable-hdpi/ic_format_underline_light.png new file mode 100644 index 0000000000000000000000000000000000000000..77711cfdff28047d42c6c49deaf1b02fbf663590 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_underline_light.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_bold_dark.png b/app/src/main/res/drawable-mdpi/ic_format_bold_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..db1cdff130960a8baeefc5b365d0ed0755c12e3d Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_bold_dark.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_bold_light.png b/app/src/main/res/drawable-mdpi/ic_format_bold_light.png new file mode 100644 index 0000000000000000000000000000000000000000..39dd8cf6ede5ac4efaed354ebfc2944baf888124 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_bold_light.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_fill_dark.png b/app/src/main/res/drawable-mdpi/ic_format_fill_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..8d931ec33afcc75445cf48e56765e4f48d7f580a Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_fill_dark.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_fill_light.png b/app/src/main/res/drawable-mdpi/ic_format_fill_light.png new file mode 100644 index 0000000000000000000000000000000000000000..29811863c7d0479792cf0bb94fe3a9a56fbcf72b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_fill_light.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_italic_dark.png b/app/src/main/res/drawable-mdpi/ic_format_italic_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..7e1c1b0d95711a5a6f35fc98a948f6abad82b202 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_italic_dark.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_italic_light.png b/app/src/main/res/drawable-mdpi/ic_format_italic_light.png new file mode 100644 index 0000000000000000000000000000000000000000..92bb92fb0ce84bf18f59017675a0baddd30660c6 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_italic_light.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_paint_dark.png b/app/src/main/res/drawable-mdpi/ic_format_paint_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..e80112a61b84b735700c46840f959003047d37c0 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_paint_dark.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_paint_light.png b/app/src/main/res/drawable-mdpi/ic_format_paint_light.png new file mode 100644 index 0000000000000000000000000000000000000000..6c420df832cfd6ba5a6320622333cfd8e847f5f2 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_paint_light.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_underline_dark.png b/app/src/main/res/drawable-mdpi/ic_format_underline_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..16bb0a7d21a018c3160a30384318c6c1b4bac9a6 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_underline_dark.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_underline_light.png b/app/src/main/res/drawable-mdpi/ic_format_underline_light.png new file mode 100644 index 0000000000000000000000000000000000000000..963103bc81bc4db3b47cf97956d955450c7d10a1 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_underline_light.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_bold_dark.png b/app/src/main/res/drawable-xhdpi/ic_format_bold_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..a4ef362a85f972be2b28c007d8aeb33969b162a6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_bold_dark.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_bold_light.png b/app/src/main/res/drawable-xhdpi/ic_format_bold_light.png new file mode 100644 index 0000000000000000000000000000000000000000..b1ad374d0538f4c3490151605820401a12b0576a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_bold_light.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_fill_dark.png b/app/src/main/res/drawable-xhdpi/ic_format_fill_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..dacbf849c1d23bdecabc6ce6f92186a41b089510 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_fill_dark.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_fill_light.png b/app/src/main/res/drawable-xhdpi/ic_format_fill_light.png new file mode 100644 index 0000000000000000000000000000000000000000..9ac52e4061d92012500c7e569370998bb2ea3ed0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_fill_light.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_italic_dark.png b/app/src/main/res/drawable-xhdpi/ic_format_italic_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..71501f700b873a7370054770b64913f383bfe615 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_italic_dark.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_italic_light.png b/app/src/main/res/drawable-xhdpi/ic_format_italic_light.png new file mode 100644 index 0000000000000000000000000000000000000000..01a46f70866f9344ac7dbec05465a37b9c351507 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_italic_light.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_paint_dark.png b/app/src/main/res/drawable-xhdpi/ic_format_paint_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..0164e3b76c8e03bae6cc1e10b1579a97791444a2 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_paint_dark.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_paint_light.png b/app/src/main/res/drawable-xhdpi/ic_format_paint_light.png new file mode 100644 index 0000000000000000000000000000000000000000..02fec67f6a45f0d78995ef3d8a3b5354b2807b4d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_paint_light.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_underline_dark.png b/app/src/main/res/drawable-xhdpi/ic_format_underline_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..ec4461c341c2b7b595b70c19d6663d631c173cb3 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_underline_dark.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_underline_light.png b/app/src/main/res/drawable-xhdpi/ic_format_underline_light.png new file mode 100644 index 0000000000000000000000000000000000000000..21f82a034d07668cc4137c72a63f40783caaab91 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_underline_light.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_bold_dark.png b/app/src/main/res/drawable-xxhdpi/ic_format_bold_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..7cc91346317305af68654b73aec0e5353e6bf703 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_bold_dark.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_bold_light.png b/app/src/main/res/drawable-xxhdpi/ic_format_bold_light.png new file mode 100644 index 0000000000000000000000000000000000000000..12d6452d52ffacc6c3b1904d2a6b7d09efc4c425 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_bold_light.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_fill_dark.png b/app/src/main/res/drawable-xxhdpi/ic_format_fill_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..dd6a03684e4e4d8927c8d2026337fee469e0d301 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_fill_dark.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_fill_light.png b/app/src/main/res/drawable-xxhdpi/ic_format_fill_light.png new file mode 100644 index 0000000000000000000000000000000000000000..7a8bc9f7411e06e0ed517c7611814a4d5d56fcbb Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_fill_light.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_italic_dark.png b/app/src/main/res/drawable-xxhdpi/ic_format_italic_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfcafc0581c7d48b2686e6e035e7125d1ba8e0a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_italic_dark.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_italic_light.png b/app/src/main/res/drawable-xxhdpi/ic_format_italic_light.png new file mode 100644 index 0000000000000000000000000000000000000000..5cefd81ff9f0f10f838920dce665f5f35a9af5dc Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_italic_light.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_paint_dark.png b/app/src/main/res/drawable-xxhdpi/ic_format_paint_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..0f708ad7838db3fd3e7d0f61dad8555a1122bebe Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_paint_dark.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_paint_light.png b/app/src/main/res/drawable-xxhdpi/ic_format_paint_light.png new file mode 100644 index 0000000000000000000000000000000000000000..d6e34ae3da79e86a9511fb735f202819e78ecb35 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_paint_light.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_underline_dark.png b/app/src/main/res/drawable-xxhdpi/ic_format_underline_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..f22f8d36daef8147c433c28c342ea99d0da89759 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_underline_dark.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_underline_light.png b/app/src/main/res/drawable-xxhdpi/ic_format_underline_light.png new file mode 100644 index 0000000000000000000000000000000000000000..e047e6f11a21daaac758e18d8ee239aa4c4433ac Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_underline_light.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_bold_dark.png b/app/src/main/res/drawable-xxxhdpi/ic_format_bold_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..0e62982ab59d78f7fc7d4eb97f179f8f7775aad6 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_bold_dark.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_bold_light.png b/app/src/main/res/drawable-xxxhdpi/ic_format_bold_light.png new file mode 100644 index 0000000000000000000000000000000000000000..47f303088158f4cc6a70703903cc9a6181571477 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_bold_light.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_fill_dark.png b/app/src/main/res/drawable-xxxhdpi/ic_format_fill_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..96874214177bdb16bce6cb145409f450c1398951 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_fill_dark.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_fill_light.png b/app/src/main/res/drawable-xxxhdpi/ic_format_fill_light.png new file mode 100644 index 0000000000000000000000000000000000000000..5641b0c08e94a0b14726227938efff3b0bef8b61 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_fill_light.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_italic_dark.png b/app/src/main/res/drawable-xxxhdpi/ic_format_italic_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..40b1e780a90d279e6649a48f67e96ce5d74d85d9 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_italic_dark.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_italic_light.png b/app/src/main/res/drawable-xxxhdpi/ic_format_italic_light.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0f3dea9d3b6413153187a5516c258131d8ec97 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_italic_light.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_paint_dark.png b/app/src/main/res/drawable-xxxhdpi/ic_format_paint_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..437fc9b9b87635578ae58915779a10582a89d330 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_paint_dark.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_paint_light.png b/app/src/main/res/drawable-xxxhdpi/ic_format_paint_light.png new file mode 100644 index 0000000000000000000000000000000000000000..08f99d3b61e1ad24a95c72cc139a32cd1da09a1f Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_paint_light.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_underline_dark.png b/app/src/main/res/drawable-xxxhdpi/ic_format_underline_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..e19b0b068cdc83ac19e928ec688a33940f4ebe28 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_underline_dark.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_underline_light.png b/app/src/main/res/drawable-xxxhdpi/ic_format_underline_light.png new file mode 100644 index 0000000000000000000000000000000000000000..cd497b16a074bdece46c2b4cb89732f53f97b12d Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_underline_light.png differ diff --git a/app/src/main/res/layout/activity_chat.xml b/app/src/main/res/layout/activity_chat.xml index 3553dfe0b3b48aa9022fd70b6188c6dbcf45f1a4..0879d3b13ad04b2be86252a8a55daa038536c77d 100644 --- a/app/src/main/res/layout/activity_chat.xml +++ b/app/src/main/res/layout/activity_chat.xml @@ -13,6 +13,7 @@ android:layout_height="match_parent" android:gravity="bottom" android:orientation="vertical" + app:umanoScrollableView="@+id/chatlineScroller" app:umanoPanelHeight="?attr/actionBarSize" app:umanoShadowHeight="4dp"> diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index cf4ffcdbe0e1a46b27234e67c1875f0e9c33f297..2fd17043229babadce6f7dd4d92228657d7d9d86 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -2,8 +2,7 @@ <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/swipe_view" android:layout_width="match_parent" - android:layout_height="0dip" - android:layout_weight="1" + android:layout_height="match_parent" android:background="?attr/colorBackground"> <android.support.v7.widget.RecyclerView diff --git a/app/src/main/res/layout/slider_main.xml b/app/src/main/res/layout/slider_main.xml index ffc9fa6c1f9a935950f0a1bd9863b5b4fb48efc1..3a658779c5b2babe50cb951115d5a86bcfd0460a 100644 --- a/app/src/main/res/layout/slider_main.xml +++ b/app/src/main/res/layout/slider_main.xml @@ -1,48 +1,114 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> +<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:sothree="http://schemas.android.com/apk/res-auto" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + xmlns:app="http://schemas.android.com/tools" + android:background="?attr/colorBackgroundCard" + android:clickable="false" + android:focusable="true" + android:gravity="bottom" + sothree:umanoFadeColor="#00000000" + sothree:umanoOverlay="true" + sothree:umanoPanelHeight="72dip" + sothree:umanoScrollableView="@+id/msg_history" + sothree:umanoShadowHeight="0.0dip"> - <LinearLayout + + <RelativeLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:animateLayoutChanges="true" - android:background="?attr/colorBackgroundCard" - android:orientation="horizontal"> + android:layout_height="match_parent" + android:paddingBottom="72dp"> - <android.support.v7.widget.AppCompatEditText - android:id="@+id/chatline" + <ScrollView + android:id="@+id/chatlineScroller" android:layout_width="0dip" - android:layout_height="?attr/actionBarSize" - android:layout_weight="1" - android:background="@android:color/transparent" - android:hint="@string/message_placeholder" - android:imeOptions="actionSend" - android:inputType="textCapSentences|textShortMessage|textAutoCorrect" - android:paddingLeft="20dp" - android:paddingRight="20dp" - android:paddingTop="19dp" - android:textSize="16sp" - android:gravity="top" - android:paddingBottom="19dp" /> + android:layout_height="match_parent" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_toLeftOf="@+id/send" + android:layout_toStartOf="@+id/send" + android:layout_alignParentTop="true" + android:layout_above="@+id/formatting_toolbar"> + + <android.support.v7.widget.AppCompatEditText + android:id="@+id/chatline" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:background="@android:color/transparent" + android:gravity="top" + android:hint="@string/message_placeholder" + android:inputType="textCapSentences|textShortMessage|textAutoCorrect" + android:paddingBottom="17dp" + android:paddingLeft="20dp" + android:paddingRight="20dp" + android:paddingTop="17dp" + android:text="@string/large_text" + android:textSize="16sp" /> + + </ScrollView> <android.support.v7.widget.AppCompatImageButton android:id="@+id/send" style="?attr/buttonStyleSmall" android:layout_width="56dp" android:layout_height="?attr/actionBarSize" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + android:layout_alignParentTop="true" android:layout_gravity="top" android:background="?attr/selectableItemBackgroundBorderless" android:padding="12dp" android:src="@drawable/ic_send" android:tint="?attr/colorAccent" /> - </LinearLayout> - <android.support.v7.widget.RecyclerView - android:id="@+id/msg_history" - android:layout_width="match_parent" - android:layout_height="0dip" - android:layout_weight="1" - android:background="?attr/colorBackgroundCard" /> -</LinearLayout> + <android.support.v7.widget.Toolbar + android:id="@+id/formatting_toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:layout_alignParentBottom="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true"> + <android.support.v7.widget.ActionMenuView + android:id="@+id/amvMenu" + android:layout_width="wrap_content" + android:layout_height="?attr/actionBarSize"/> + </android.support.v7.widget.Toolbar> + </RelativeLayout> + + <FrameLayout + android:id="@+id/card_panel" + android:layout_width="fill_parent" + android:layout_height="wrap_content"> + + <android.support.v7.widget.CardView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16.0dip" + android:layout_marginLeft="16.0dip" + android:layout_marginRight="16.0dip" + android:layout_marginTop="16.0dip"> + + <LinearLayout + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + android:layout_width="fill_parent" + android:layout_height="48.0dip" + android:gravity="center_vertical" + android:paddingLeft="16.0dip" + android:paddingRight="16.0dip" + android:text="Message History" + android:textAppearance="@style/TextAppearance.AppCompat.Body2" + android:textColor="?attr/colorForegroundSecondary" /> + + <android.support.v7.widget.RecyclerView + android:id="@+id/msg_history" + android:layout_width="fill_parent" + android:layout_height="wrap_content" /> + </LinearLayout> + </android.support.v7.widget.CardView> + </FrameLayout> +</com.sothree.slidinguppanel.SlidingUpPanelLayout> diff --git a/app/src/main/res/menu/formatting.xml b/app/src/main/res/menu/formatting.xml new file mode 100644 index 0000000000000000000000000000000000000000..1e05f147149efe417403fecdf1ffe8d76d165779 --- /dev/null +++ b/app/src/main/res/menu/formatting.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/format_bold" + android:icon="?attr/ic_format_bold" + app:showAsAction="always" + android:title="@string/format_bold" /> + <item + android:id="@+id/format_italic" + android:icon="?attr/ic_format_italic" + app:showAsAction="always" + android:title="@string/format_italic" /> + <item + android:id="@+id/format_underline" + android:icon="?attr/ic_format_underline" + app:showAsAction="always" + android:title="@string/format_underline" /> + <item + android:id="@+id/format_paint" + android:icon="?attr/ic_format_paint" + app:showAsAction="always" + android:title="@string/format_color" /> + <item + android:id="@+id/format_fill" + android:icon="?attr/ic_format_fill" + app:showAsAction="always" + android:title="@string/format_fill" /> +</menu> diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index e5604dde79d2266944b8f3f4a8f095b8fd800adb..013b7f2c3a642d5348c5baeee91d493bcd16fe81 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -58,4 +58,11 @@ <attr name="colorTintMessage" format="color" /> <attr name="colorTintHighlight" format="color" /> <attr name="chatlineExpandedSize" /> + + <!-- Format icons --> + <attr name="ic_format_bold" format="reference" /> + <attr name="ic_format_italic" format="reference" /> + <attr name="ic_format_underline" format="reference" /> + <attr name="ic_format_paint" format="reference" /> + <attr name="ic_format_fill" format="reference" /> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 052fda0a1024113b61e482038440864997ca6910..840c11d7553aaf4f53d21f7b913c5977b65d3e22 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -39,4 +39,100 @@ <!-- Preferences --> <string name="preference_theme">preference_theme</string> <string name="preference_full_hostmask">preference_full_hostmask</string> + <string name="title_activity_scrolling">ScrollingActivity</string> + <string name="large_text"> + "Material is the metaphor.\n\n" + + "A material metaphor is the unifying theory of a rationalized space and a system of motion." + "The material is grounded in tactile reality, inspired by the study of paper and ink, yet " + "technologically advanced and open to imagination and magic.\n" + "Surfaces and edges of the material provide visual cues that are grounded in reality. The " + "use of familiar tactile attributes helps users quickly understand affordances. Yet the " + "flexibility of the material creates new affordances that supercede those in the physical " + "world, without breaking the rules of physics.\n" + "The fundamentals of light, surface, and movement are key to conveying how objects move, " + "interact, and exist in space and in relation to each other. Realistic lighting shows " + "seams, divides space, and indicates moving parts.\n\n" + + "Bold, graphic, intentional.\n\n" + + "The foundational elements of print based design typography, grids, space, scale, color, " + "and use of imagery guide visual treatments. These elements do far more than please the " + "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge " + "imagery, large scale typography, and intentional white space create a bold and graphic " + "interface that immerse the user in the experience.\n" + "An emphasis on user actions makes core functionality immediately apparent and provides " + "waypoints for the user.\n\n" + + "Motion provides meaning.\n\n" + + "Motion respects and reinforces the user as the prime mover. Primary user actions are " + "inflection points that initiate motion, transforming the whole design.\n" + "All action takes place in a single environment. Objects are presented to the user without " + "breaking the continuity of experience even as they transform and reorganize.\n" + "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. " + "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" + + "3D world.\n\n" + + "The material environment is a 3D space, which means all objects have x, y, and z " + "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the " + "positive z-axis extending towards the viewer. Every sheet of material occupies a single " + "position along the z-axis and has a standard 1dp thickness.\n" + "On the web, the z-axis is used for layering and not for perspective. The 3D world is " + "emulated by manipulating the y-axis.\n\n" + + "Light and shadow.\n\n" + + "Within the material environment, virtual lights illuminate the scene. Key lights create " + "directional shadows, while ambient light creates soft shadows from all angles.\n" + "Shadows in the material environment are cast by these two light sources. In Android " + "development, shadows occur when light sources are blocked by sheets of material at " + "various positions along the z-axis. On the web, shadows are depicted by manipulating the " + "y-axis only. The following example shows the card with a height of 6dp.\n\n" + + "Resting elevation.\n\n" + + "All material objects, regardless of size, have a resting elevation, or default elevation " + "that does not change. If an object changes elevation, it should return to its resting " + "elevation as soon as possible.\n\n" + + "Component elevations.\n\n" + + "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " + "does not vary from 6dp in one app to 16dp in another app).\n" + "Components may have different resting elevations across platforms, depending on the depth " + "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" + + "Responsive elevation and dynamic elevation offsets.\n\n" + + "Some component types have responsive elevation, meaning they change elevation in response " + "to user input (e.g., normal, focused, and pressed) or system events. These elevation " + "changes are consistently implemented using dynamic elevation offsets.\n" + "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " + "to the component’s resting state. They ensure that elevation changes are consistent " + "across actions and component types. For example, all components that lift on press have " + "the same elevation change relative to their resting elevation.\n" + "Once the input event is completed or cancelled, the component will return to its resting " + "elevation.\n\n" + + "Avoiding elevation interference.\n\n" + + "Components with responsive elevations may encounter other components as they move between " + "their resting elevations and dynamic elevation offsets. Because material cannot pass " + "through other material, components avoid interfering with one another any number of ways, " + "whether on a per component basis or using the entire app layout.\n" + "On a component level, components can move or be removed before they cause interference. " + "For example, a floating action button (FAB) can disappear or move off screen before a " + "user picks up a card, or it can move if a snackbar appears.\n" + "On the layout level, design your app layout to minimize opportunities for interference. " + "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere " + "when a user tries to pick up one of cards.\n\n" + </string> + <string name="title_activity_demo">DemoActivity</string> + <string name="format_bold">Bold</string> + <string name="format_italic">Italic</string> + <string name="format_underline">Underline</string> + <string name="format_color">Text color</string> + <string name="format_fill">Background color</string> </resources> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ad7c3921054f3d52c66246d77e90d32d8d7d1c1a..26b119926713329d161d7857b163e67a53f89eb7 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -10,6 +10,12 @@ <item name="colorControlHighlight">@color/colorAccentFocus</item> <item name="windowActionModeOverlay">true</item> + + <item name="ic_format_bold">@drawable/ic_format_bold_dark</item> + <item name="ic_format_italic">@drawable/ic_format_italic_dark</item> + <item name="ic_format_underline">@drawable/ic_format_underline_dark</item> + <item name="ic_format_paint">@drawable/ic_format_paint_dark</item> + <item name="ic_format_fill">@drawable/ic_format_fill_dark</item> </style> <style name="AppTheme.Light" parent="MaterialDrawerTheme.Light.DarkToolbar.TranslucentStatus"> @@ -21,6 +27,12 @@ <item name="colorControlHighlight">@color/colorAccentFocus</item> <item name="windowActionModeOverlay">true</item> + + <item name="ic_format_bold">@drawable/ic_format_bold_light</item> + <item name="ic_format_italic">@drawable/ic_format_italic_light</item> + <item name="ic_format_underline">@drawable/ic_format_underline_light</item> + <item name="ic_format_paint">@drawable/ic_format_paint_light</item> + <item name="ic_format_fill">@drawable/ic_format_fill_light</item> </style> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />