diff --git a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java index c64fde7..a8f35fc 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java +++ b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java @@ -3,11 +3,15 @@ package ch.dissem.apps.abit; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; +import ch.dissem.bitmessage.entity.BitmessageAddress; /** * Compose a new message. */ public class ComposeMessageActivity extends AppCompatActivity { + public static final String EXTRA_IDENTITY = "ch.dissem.abit.Message.SENDER"; + public static final String EXTRA_RECIPIENT = "ch.dissem.abit.Message.RECIPIENT"; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -21,8 +25,10 @@ public class ComposeMessageActivity extends AppCompatActivity { getSupportActionBar().setHomeButtonEnabled(false); // Display the fragment as the main content. + ComposeMessageFragment fragment = new ComposeMessageFragment(); + fragment.setArguments(getIntent().getExtras()); getSupportFragmentManager().beginTransaction() - .replace(R.id.content, new ComposeMessageFragment()) + .replace(R.id.content, fragment) .commit(); } } diff --git a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.java b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.java index 27615a0..88145fb 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.java +++ b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.java @@ -9,19 +9,13 @@ import android.widget.Toast; import ch.dissem.bitmessage.BitmessageContext; import ch.dissem.bitmessage.entity.BitmessageAddress; +import static ch.dissem.apps.abit.ComposeMessageActivity.EXTRA_IDENTITY; +import static ch.dissem.apps.abit.ComposeMessageActivity.EXTRA_RECIPIENT; + /** * Compose a new message. */ public class ComposeMessageFragment extends Fragment { - /** - * The fragment argument representing the sender identity. - */ - public static final String ARG_IDENTITY = "from"; - /** - * The fragment argument representing the recipient. - */ - public static final String ARG_RECIPIENT = "to"; - private BitmessageContext bmCtx; private BitmessageAddress identity; private BitmessageAddress recipient; @@ -37,11 +31,11 @@ public class ComposeMessageFragment extends Fragment { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { - if (getArguments().containsKey(ARG_IDENTITY)) { - identity = (BitmessageAddress) getArguments().getSerializable(ARG_IDENTITY); + if (getArguments().containsKey(EXTRA_IDENTITY)) { + identity = (BitmessageAddress) getArguments().getSerializable(EXTRA_IDENTITY); } - if (getArguments().containsKey(ARG_RECIPIENT)) { - recipient = (BitmessageAddress) getArguments().getSerializable(ARG_RECIPIENT); + if (getArguments().containsKey(EXTRA_RECIPIENT)) { + recipient = (BitmessageAddress) getArguments().getSerializable(EXTRA_RECIPIENT); } } setHasOptionsMenu(true); @@ -51,6 +45,10 @@ public class ComposeMessageFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_compose_message, container, false); + if (recipient != null) { + EditText recipientInput = (EditText) rootView.findViewById(R.id.recipient); + recipientInput.setText(recipient.toString()); + } EditText body = (EditText) rootView.findViewById(R.id.body); body.setInputType(EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE); body.setImeOptions(EditorInfo.IME_ACTION_SEND | EditorInfo.IME_FLAG_NO_ENTER_ACTION); diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.java b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.java index 03b3c30..dfe0d14 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.java +++ b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.java @@ -1,16 +1,18 @@ package ch.dissem.apps.abit; +import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; +import android.view.*; import android.widget.ImageView; import android.widget.TextView; import ch.dissem.apps.abit.service.Singleton; +import ch.dissem.apps.abit.utils.Drawables; +import ch.dissem.bitmessage.BitmessageContext; import ch.dissem.bitmessage.entity.BitmessageAddress; import ch.dissem.bitmessage.entity.Plaintext; import ch.dissem.bitmessage.entity.valueobject.Label; +import com.mikepenz.google_material_typeface_library.GoogleMaterial; import java.util.Iterator; @@ -29,10 +31,11 @@ public class MessageDetailFragment extends Fragment { public static final String ARG_ITEM = "item"; /** - * The dummy content this fragment is presenting. + * The content this fragment is presenting. */ private Plaintext item; + /** * Mandatory empty constructor for the fragment manager to instantiate the * fragment (e.g. upon screen orientation changes). @@ -50,6 +53,7 @@ public class MessageDetailFragment extends Fragment { // to load content from a content provider. item = (Plaintext) getArguments().getSerializable(ARG_ITEM); } + setHasOptionsMenu(true); } @Override @@ -84,4 +88,57 @@ public class MessageDetailFragment extends Fragment { } return rootView; } + + @Override + public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + inflater.inflate(R.menu.message, menu); + + Drawables.addIcon(getActivity(), menu, R.id.reply, GoogleMaterial.Icon.gmd_reply); + Drawables.addIcon(getActivity(), menu, R.id.delete, GoogleMaterial.Icon.gmd_delete); + Drawables.addIcon(getActivity(), menu, R.id.mark_unread, GoogleMaterial.Icon.gmd_markunread); + Drawables.addIcon(getActivity(), menu, R.id.archive, GoogleMaterial.Icon.gmd_archive); + + super.onCreateOptionsMenu(menu, inflater); + } + + @Override + public boolean onOptionsItemSelected(MenuItem menuItem) { + BitmessageContext bmc = Singleton.getBitmessageContext(getActivity()); + switch (menuItem.getItemId()) { + case R.id.reply: + Intent replyIntent = new Intent(getActivity().getApplicationContext(), ComposeMessageActivity.class); + replyIntent.putExtra(ComposeMessageActivity.EXTRA_RECIPIENT, item.getFrom()); + replyIntent.putExtra(ComposeMessageActivity.EXTRA_IDENTITY, item.getTo()); + startActivity(replyIntent); + return true; + case R.id.delete: + if (isInTrash(item)) { + bmc.messages().remove(item); + } else { + item.getLabels().clear(); + item.addLabels(bmc.messages().getLabels(Label.Type.TRASH)); + bmc.messages().save(item); + } + return true; + case R.id.mark_unread: + item.addLabels(bmc.messages().getLabels(Label.Type.UNREAD)); + bmc.messages().save(item); + return true; + case R.id.archive: + item.getLabels().clear(); + bmc.messages().save(item); + return true; + default: + return false; + } + } + + private boolean isInTrash(Plaintext item) { + for (Label label : item.getLabels()) { + if (label.getType() == Label.Type.TRASH) { + return true; + } + } + return false; + } } diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java b/app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java index 7c24cb1..84c2dc0 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java +++ b/app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java @@ -8,6 +8,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; +import ch.dissem.apps.abit.listeners.ActionBarListener; import ch.dissem.apps.abit.service.Singleton; import ch.dissem.bitmessage.BitmessageContext; import ch.dissem.bitmessage.entity.BitmessageAddress; @@ -51,7 +52,7 @@ import java.util.ArrayList; *

*/ public class MessageListActivity extends AppCompatActivity - implements MessageListFragment.Callbacks { + implements MessageListFragment.Callbacks, ActionBarListener { public static final String EXTRA_SHOW_MESSAGE = "ch.dissem.abit.ShowMessage"; public static final String ACTION_SHOW_INBOX = "ch.dissem.abit.ShowInbox"; @@ -157,7 +158,30 @@ public class MessageListActivity extends AppCompatActivity ArrayList drawerItems = new ArrayList<>(); for (Label label : bmc.messages().getLabels()) { - drawerItems.add(new PrimaryDrawerItem().withName(label.toString()).withTag(label)); + PrimaryDrawerItem item = new PrimaryDrawerItem().withName(label.toString()).withTag(label); + switch (label.getType()) { + case INBOX: + item.withIcon(GoogleMaterial.Icon.gmd_inbox); + break; + case DRAFT: + item.withIcon(CommunityMaterial.Icon.cmd_file); + break; + case SENT: + item.withIcon(CommunityMaterial.Icon.cmd_send); + break; + case BROADCAST: + item.withIcon(CommunityMaterial.Icon.cmd_rss); + break; + case UNREAD: + item.withIcon(GoogleMaterial.Icon.gmd_markunread_mailbox); + break; + case TRASH: + item.withIcon(GoogleMaterial.Icon.gmd_delete); + break; + default: + item.withIcon(CommunityMaterial.Icon.cmd_label); + } + drawerItems.add(item); } new DrawerBuilder() @@ -168,7 +192,7 @@ public class MessageListActivity extends AppCompatActivity .addStickyDrawerItems( new SecondaryDrawerItem() .withName(getString(R.string.subscriptions)) - .withIcon(CommunityMaterial.Icon.cmd_rss), + .withIcon(CommunityMaterial.Icon.cmd_rss_box), new SecondaryDrawerItem() .withName(R.string.settings) .withIcon(GoogleMaterial.Icon.gmd_settings) @@ -254,6 +278,11 @@ public class MessageListActivity extends AppCompatActivity } } + @Override + public void updateTitle(CharSequence title) { + getSupportActionBar().setTitle(title); + } + public Label getSelectedLabel() { return selectedLabel; } diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.java b/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.java index abbd60d..45ef52b 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.java +++ b/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.java @@ -6,17 +6,17 @@ import android.graphics.Typeface; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.ListFragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; +import android.view.*; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; +import ch.dissem.apps.abit.listeners.ActionBarListener; import ch.dissem.apps.abit.service.Singleton; import ch.dissem.bitmessage.BitmessageContext; import ch.dissem.bitmessage.entity.Plaintext; import ch.dissem.bitmessage.entity.valueobject.Label; +import ch.dissem.bitmessage.ports.MessageRepository; /** * A list fragment representing a list of Messages. This fragment @@ -39,12 +39,15 @@ public class MessageListFragment extends ListFragment { * The fragment's current callback object, which is notified of list item * clicks. */ - private Callbacks mCallbacks = sDummyCallbacks; + private Callbacks callbacks = dummyCallbacks; /** * The current activated item position. Only used on tablets. */ - private int mActivatedPosition = ListView.INVALID_POSITION; + private int activatedPosition = ListView.INVALID_POSITION; + + private Label currentLabel; + private MenuItem emptyTrashMenuItem; private BitmessageContext bmc; @@ -64,7 +67,7 @@ public class MessageListFragment extends ListFragment { * A dummy implementation of the {@link Callbacks} interface that does * nothing. Used only when this fragment is not attached to an activity. */ - private static Callbacks sDummyCallbacks = new Callbacks() { + private static Callbacks dummyCallbacks = new Callbacks() { @Override public void onItemSelected(Plaintext plaintext) { } @@ -82,6 +85,7 @@ public class MessageListFragment extends ListFragment { super.onCreate(savedInstanceState); bmc = Singleton.getBitmessageContext(getActivity()); + setHasOptionsMenu(true); } @Override @@ -92,6 +96,7 @@ public class MessageListFragment extends ListFragment { } public void updateList(Label label) { + currentLabel = label; setListAdapter(new ArrayAdapter( getActivity(), android.R.layout.simple_list_item_activated_1, @@ -120,6 +125,12 @@ public class MessageListFragment extends ListFragment { return convertView; } }); + if (getActivity() instanceof ActionBarListener) { + ((ActionBarListener) getActivity()).updateTitle(label.toString()); + } + if (emptyTrashMenuItem != null) { + emptyTrashMenuItem.setVisible(label != null && label.getType() == Label.Type.TRASH); + } } @Override @@ -158,7 +169,7 @@ public class MessageListFragment extends ListFragment { throw new IllegalStateException("Activity must implement fragment's callbacks."); } - mCallbacks = (Callbacks) activity; + callbacks = (Callbacks) activity; } @Override @@ -166,7 +177,31 @@ public class MessageListFragment extends ListFragment { super.onDetach(); // Reset the active callbacks interface to the dummy implementation. - mCallbacks = sDummyCallbacks; + callbacks = dummyCallbacks; + } + + @Override + public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + inflater.inflate(R.menu.message_list, menu); + emptyTrashMenuItem = menu.findItem(R.id.empty_trash); + super.onCreateOptionsMenu(menu, inflater); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.empty_trash: + if (currentLabel.getType() != Label.Type.TRASH) return true; + + MessageRepository repo = bmc.messages(); + for (Plaintext message : repo.findMessages(currentLabel)) { + repo.remove(message); + } + updateList(currentLabel); + return true; + default: + return false; + } } @Override @@ -175,15 +210,15 @@ public class MessageListFragment extends ListFragment { // Notify the active callbacks interface (the activity, if the // fragment is attached to one) that an item has been selected. - mCallbacks.onItemSelected((Plaintext) listView.getItemAtPosition(position)); + callbacks.onItemSelected((Plaintext) listView.getItemAtPosition(position)); } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - if (mActivatedPosition != ListView.INVALID_POSITION) { + if (activatedPosition != ListView.INVALID_POSITION) { // Serialize and persist the activated item position. - outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition); + outState.putInt(STATE_ACTIVATED_POSITION, activatedPosition); } } @@ -201,11 +236,11 @@ public class MessageListFragment extends ListFragment { private void setActivatedPosition(int position) { if (position == ListView.INVALID_POSITION) { - getListView().setItemChecked(mActivatedPosition, false); + getListView().setItemChecked(activatedPosition, false); } else { getListView().setItemChecked(position, true); } - mActivatedPosition = position; + activatedPosition = position; } } diff --git a/app/src/main/java/ch/dissem/apps/abit/listeners/ActionBarListener.java b/app/src/main/java/ch/dissem/apps/abit/listeners/ActionBarListener.java new file mode 100644 index 0000000..11b309a --- /dev/null +++ b/app/src/main/java/ch/dissem/apps/abit/listeners/ActionBarListener.java @@ -0,0 +1,24 @@ +/* + * Copyright 2015 Christian Basler + * + * 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. + */ + +package ch.dissem.apps.abit.listeners; + +/** + * Created by chris on 06.09.15. + */ +public interface ActionBarListener { + void updateTitle(CharSequence title); +} diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageListener.java b/app/src/main/java/ch/dissem/apps/abit/listeners/MessageListener.java similarity index 97% rename from app/src/main/java/ch/dissem/apps/abit/MessageListener.java rename to app/src/main/java/ch/dissem/apps/abit/listeners/MessageListener.java index c9adc4f..104ef70 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageListener.java +++ b/app/src/main/java/ch/dissem/apps/abit/listeners/MessageListener.java @@ -14,9 +14,10 @@ * limitations under the License. */ -package ch.dissem.apps.abit; +package ch.dissem.apps.abit.listeners; import android.annotation.TargetApi; +import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; @@ -33,6 +34,9 @@ import android.text.Spannable; import android.text.SpannableString; import android.text.Spanned; import android.text.style.StyleSpan; +import ch.dissem.apps.abit.Identicon; +import ch.dissem.apps.abit.MessageListActivity; +import ch.dissem.apps.abit.R; import ch.dissem.bitmessage.BitmessageContext; import ch.dissem.bitmessage.entity.Plaintext; diff --git a/app/src/main/java/ch/dissem/apps/abit/service/Singleton.java b/app/src/main/java/ch/dissem/apps/abit/service/Singleton.java index 8b0c68a..46b46e1 100644 --- a/app/src/main/java/ch/dissem/apps/abit/service/Singleton.java +++ b/app/src/main/java/ch/dissem/apps/abit/service/Singleton.java @@ -1,7 +1,7 @@ package ch.dissem.apps.abit.service; import android.content.Context; -import ch.dissem.apps.abit.MessageListener; +import ch.dissem.apps.abit.listeners.MessageListener; import ch.dissem.apps.abit.repositories.AndroidAddressRepository; import ch.dissem.apps.abit.repositories.AndroidInventory; import ch.dissem.apps.abit.repositories.AndroidMessageRepository; diff --git a/app/src/main/java/ch/dissem/apps/abit/utils/Drawables.java b/app/src/main/java/ch/dissem/apps/abit/utils/Drawables.java new file mode 100644 index 0000000..d646608 --- /dev/null +++ b/app/src/main/java/ch/dissem/apps/abit/utils/Drawables.java @@ -0,0 +1,32 @@ +/* + * Copyright 2015 Christian Basler + * + * 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. + */ + +package ch.dissem.apps.abit.utils; + +import android.content.Context; +import android.view.Menu; +import ch.dissem.apps.abit.R; +import com.mikepenz.google_material_typeface_library.GoogleMaterial; +import com.mikepenz.iconics.IconicsDrawable; + +/** + * Some helper methods to work with drawables. + */ +public class Drawables { + public static void addIcon(Context ctx, Menu menu, int menuItem, GoogleMaterial.Icon icon) { + menu.findItem(menuItem).setIcon(new IconicsDrawable(ctx, icon).colorRes(R.color.primary_text_default_material_dark).actionBar()); + } +} diff --git a/app/src/main/res/drawable-hdpi/ic_action_delete.png b/app/src/main/res/drawable-hdpi/ic_action_delete.png old mode 100644 new mode 100755 index 4bb5259..d912755 Binary files a/app/src/main/res/drawable-hdpi/ic_action_delete.png and b/app/src/main/res/drawable-hdpi/ic_action_delete.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_action_mark_unread.png b/app/src/main/res/drawable-hdpi/ic_action_mark_unread.png new file mode 100644 index 0000000..c9ce724 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_mark_unread.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_action_placeholder.png b/app/src/main/res/drawable-hdpi/ic_action_placeholder.png new file mode 100644 index 0000000..cde7713 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_placeholder.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_action_reply.png b/app/src/main/res/drawable-hdpi/ic_action_reply.png old mode 100644 new mode 100755 index be372f5..7414772 Binary files a/app/src/main/res/drawable-hdpi/ic_action_reply.png and b/app/src/main/res/drawable-hdpi/ic_action_reply.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_delete.png b/app/src/main/res/drawable-mdpi/ic_action_delete.png old mode 100644 new mode 100755 index 95258c3..864553a Binary files a/app/src/main/res/drawable-mdpi/ic_action_delete.png and b/app/src/main/res/drawable-mdpi/ic_action_delete.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_mark_unread.png b/app/src/main/res/drawable-mdpi/ic_action_mark_unread.png new file mode 100644 index 0000000..f74f84a Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_mark_unread.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_placeholder.png b/app/src/main/res/drawable-mdpi/ic_action_placeholder.png new file mode 100644 index 0000000..6fd4dcd Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_placeholder.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_reply.png b/app/src/main/res/drawable-mdpi/ic_action_reply.png old mode 100644 new mode 100755 index f93102a..a25803b Binary files a/app/src/main/res/drawable-mdpi/ic_action_reply.png and b/app/src/main/res/drawable-mdpi/ic_action_reply.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_delete.png b/app/src/main/res/drawable-xhdpi/ic_action_delete.png old mode 100644 new mode 100755 index 35c97c1..37e9c21 Binary files a/app/src/main/res/drawable-xhdpi/ic_action_delete.png and b/app/src/main/res/drawable-xhdpi/ic_action_delete.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_mark_unread.png b/app/src/main/res/drawable-xhdpi/ic_action_mark_unread.png new file mode 100644 index 0000000..35083d1 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_mark_unread.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_placeholder.png b/app/src/main/res/drawable-xhdpi/ic_action_placeholder.png new file mode 100644 index 0000000..ae7c98f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_placeholder.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_reply.png b/app/src/main/res/drawable-xhdpi/ic_action_reply.png old mode 100644 new mode 100755 index ea7c4ea..8b1d033 Binary files a/app/src/main/res/drawable-xhdpi/ic_action_reply.png and b/app/src/main/res/drawable-xhdpi/ic_action_reply.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_delete.png b/app/src/main/res/drawable-xxhdpi/ic_action_delete.png old mode 100644 new mode 100755 index cfb99e1..ef8e4bb Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_delete.png and b/app/src/main/res/drawable-xxhdpi/ic_action_delete.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_mark_unread.png b/app/src/main/res/drawable-xxhdpi/ic_action_mark_unread.png new file mode 100644 index 0000000..968b849 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_mark_unread.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_placeholder.png b/app/src/main/res/drawable-xxhdpi/ic_action_placeholder.png new file mode 100644 index 0000000..55f33b9 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_placeholder.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_reply.png b/app/src/main/res/drawable-xxhdpi/ic_action_reply.png old mode 100644 new mode 100755 index 9b6d9ef..15a3089 Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_reply.png and b/app/src/main/res/drawable-xxhdpi/ic_action_reply.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_delete.png b/app/src/main/res/drawable-xxxhdpi/ic_action_delete.png new file mode 100755 index 0000000..b664828 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_delete.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_reply.png b/app/src/main/res/drawable-xxxhdpi/ic_action_reply.png new file mode 100755 index 0000000..2f08cc8 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_reply.png differ diff --git a/app/src/main/res/layout/fragment_subscribtions.xml b/app/src/main/res/layout/fragment_subscribtions.xml new file mode 100644 index 0000000..cd73e5b --- /dev/null +++ b/app/src/main/res/layout/fragment_subscribtions.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout 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"> + + <ListView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:id="@id/android:list" + + android:paddingBottom="88dp" + android:clipToPadding="false" + android:scrollbarStyle="outsideOverlay" + + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_alignParentBottom="true"/> + + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab_compose_message" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_fab_compose_message" + app:elevation="8dp" + android:layout_alignParentBottom="true" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + android:layout_margin="16dp"/> +</RelativeLayout> \ No newline at end of file diff --git a/app/src/main/res/menu/message.xml b/app/src/main/res/menu/message.xml new file mode 100644 index 0000000..aee2121 --- /dev/null +++ b/app/src/main/res/menu/message.xml @@ -0,0 +1,25 @@ +<?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/reply" + app:showAsAction="ifRoom" + android:icon="@drawable/ic_action_placeholder" + android:title="@string/reply"/> + <item + android:id="@+id/delete" + app:showAsAction="ifRoom" + android:icon="@drawable/ic_action_placeholder" + android:title="@string/delete"/> + <item + android:id="@+id/mark_unread" + app:showAsAction="ifRoom" + android:icon="@drawable/ic_action_placeholder" + android:title="@string/mark_unread"/> + <item + android:id="@+id/archive" + app:showAsAction="ifRoom" + android:icon="@drawable/ic_action_placeholder" + android:title="@string/archive"/> +</menu> \ No newline at end of file diff --git a/app/src/main/res/menu/message_list.xml b/app/src/main/res/menu/message_list.xml new file mode 100644 index 0000000..75f182b --- /dev/null +++ b/app/src/main/res/menu/message_list.xml @@ -0,0 +1,11 @@ +<?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/empty_trash" + app:showAsAction="never" + android:icon="@drawable/ic_action_placeholder" + android:title="@string/empty_trash" + android:visible="false"/> +</menu> \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 25eeaba..552ee71 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -24,4 +24,10 @@ <string name="manage_identity">Identität verwalten</string> <string name="subscribe">Abonnieren</string> <string name="title_activity_open_bitmessage_link">Kontakt importieren</string> + <string name="delete">Löschen</string> + <string name="reply">Antworten</string> + <string name="n_new_messages">%d neue Nachrichten</string> + <string name="archive">Archiv</string> + <string name="empty_trash">Papierkorb leeren</string> + <string name="mark_unread">Als ungelesen markieren</string> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9dad53f..2034dac 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -27,4 +27,7 @@ <string name="n_new_messages">%d new messages</string> <string name="reply">Reply</string> <string name="delete">Delete</string> + <string name="mark_unread">Mark unread</string> + <string name="archive">Archive</string> + <string name="empty_trash">Empty Trash</string> </resources>