diff --git a/app/build.gradle b/app/build.gradle
index 679e0a6..957eac4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -37,6 +37,8 @@ dependencies {
compile('com.mikepenz:materialdrawer:3.1.0@aar') {
transitive = true
}
+ compile 'com.mikepenz:iconics:1.6.2@aar'
+ compile 'com.mikepenz:community-material-typeface:1.1.71@aar'
}
idea.module {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3f38a3f..e94bbb0 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -30,12 +30,45 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".MessageListActivity"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -46,6 +79,22 @@
android:exported="true"
android:permission="">
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java
new file mode 100644
index 0000000..c64fde7
--- /dev/null
+++ b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java
@@ -0,0 +1,28 @@
+package ch.dissem.apps.abit;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+
+/**
+ * Compose a new message.
+ */
+public class ComposeMessageActivity extends AppCompatActivity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.toolbar_layout);
+
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_action_close);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setHomeButtonEnabled(false);
+
+ // Display the fragment as the main content.
+ getSupportFragmentManager().beginTransaction()
+ .replace(R.id.content, new ComposeMessageFragment())
+ .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
new file mode 100644
index 0000000..27615a0
--- /dev/null
+++ b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.java
@@ -0,0 +1,77 @@
+package ch.dissem.apps.abit;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.*;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.Toast;
+import ch.dissem.bitmessage.BitmessageContext;
+import ch.dissem.bitmessage.entity.BitmessageAddress;
+
+/**
+ * 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;
+
+ /**
+ * Mandatory empty constructor for the fragment manager to instantiate the
+ * fragment (e.g. upon screen orientation changes).
+ */
+ public ComposeMessageFragment() {
+ }
+
+ @Override
+ 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(ARG_RECIPIENT)) {
+ recipient = (BitmessageAddress) getArguments().getSerializable(ARG_RECIPIENT);
+ }
+ }
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.fragment_compose_message, container, false);
+ 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);
+ return rootView;
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.compose, menu);
+ super.onCreateOptionsMenu(menu, inflater);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.send:
+ Toast.makeText(getActivity(), "TODO: Send", Toast.LENGTH_SHORT).show();
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+}
+
diff --git a/app/src/main/java/ch/dissem/apps/abit/Identicon.java b/app/src/main/java/ch/dissem/apps/abit/Identicon.java
new file mode 100644
index 0000000..3222b78
--- /dev/null
+++ b/app/src/main/java/ch/dissem/apps/abit/Identicon.java
@@ -0,0 +1,102 @@
+/*
+ * 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;
+
+
+import android.graphics.*;
+import android.graphics.drawable.Drawable;
+import ch.dissem.bitmessage.entity.BitmessageAddress;
+
+/**
+ *
+ */
+public class Identicon extends Drawable {
+ private static final int SIZE = 9;
+ private static final int CENTER_COLUMN = 5;
+
+ private final Paint paint;
+ private float cellWidth;
+ private float cellHeight;
+ private byte[] hash;
+ private int color;
+ private int background;
+ private boolean[][] fields;
+
+ public Identicon(BitmessageAddress input) {
+ paint = new Paint();
+ paint.setStyle(Paint.Style.FILL);
+ paint.setAntiAlias(true);
+
+ hash = input.getRipe();
+
+ fields = new boolean[SIZE][SIZE];
+ color = Color.HSVToColor(new float[]{Math.abs(hash[0] * hash[1] + hash[2]) % 360, 0.8f, 1.0f});
+ background = Color.HSVToColor(new float[]{Math.abs(hash[1] * hash[2] + hash[0]) % 360, 0.8f, 1.0f});
+
+ for (int row = 0; row < SIZE; row++) {
+ for (int column = 0; column < SIZE; column++) {
+ fields[row][column] = hash[(row * (column < CENTER_COLUMN ? column : SIZE - column - 1)) % hash.length] >= 0;
+ }
+ }
+ }
+
+ protected byte getByte(int index) {
+ return hash[index % hash.length];
+ }
+
+ @Override
+ public void draw(Canvas canvas) {
+ float x, y;
+ paint.setColor(background);
+ canvas.drawPaint(paint);
+ paint.setColor(color);
+ for (int row = 0; row < SIZE; row++) {
+ for (int column = 0; column < SIZE; column++) {
+ if (fields[row][column]) {
+ x = cellWidth * column;
+ y = cellHeight * row;
+
+ canvas.drawCircle(x + cellWidth / 2, y + cellHeight / 2, cellHeight / 2, paint);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void setAlpha(int alpha) {
+ paint.setAlpha(alpha);
+ }
+
+ @Override
+ public void setColorFilter(ColorFilter cf) {
+ paint.setColorFilter(cf);
+ }
+
+ @Override
+ public int getOpacity() {
+ return PixelFormat.OPAQUE;
+ }
+
+ @Override
+ protected void onBoundsChange(Rect bounds) {
+ super.onBoundsChange(bounds);
+
+ cellWidth = bounds.width() / (float) SIZE;
+ cellHeight = bounds.height() / (float) SIZE;
+ }
+
+}
\ No newline at end of file
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 94376e3..ec02e0c 100644
--- a/app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java
+++ b/app/src/main/java/ch/dissem/apps/abit/MessageListActivity.java
@@ -5,13 +5,16 @@ import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
+import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
+import android.widget.Toast;
import ch.dissem.apps.abit.service.Singleton;
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.community_material_typeface_library.CommunityMaterial;
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
import com.mikepenz.iconics.IconicsDrawable;
import com.mikepenz.materialdrawer.Drawer;
@@ -59,6 +62,7 @@ public class MessageListActivity extends AppCompatActivity
private AccountHeader accountHeader;
private BitmessageContext bmc;
private Label selectedLabel;
+ private Menu menu;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -68,7 +72,7 @@ public class MessageListActivity extends AppCompatActivity
setContentView(R.layout.activity_message_list);
- Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (findViewById(R.id.message_detail_container) != null) {
@@ -109,7 +113,7 @@ public class MessageListActivity extends AppCompatActivity
.withIdentifier(ADD_IDENTITY)
);
profiles.add(new ProfileSettingDrawerItem()
- .withName("Manage Account")
+ .withName(getString(R.string.manage_identity))
.withIcon(GoogleMaterial.Icon.gmd_settings)
);
// Create the AccountHeader
@@ -150,6 +154,9 @@ public class MessageListActivity extends AppCompatActivity
.withAccountHeader(accountHeader)
.withDrawerItems(drawerItems)
.addStickyDrawerItems(
+ new SecondaryDrawerItem()
+ .withName(getString(R.string.subscriptions))
+ .withIcon(CommunityMaterial.Icon.cmd_rss),
new SecondaryDrawerItem()
.withName(R.string.settings)
.withIcon(GoogleMaterial.Icon.gmd_settings)
@@ -162,6 +169,9 @@ public class MessageListActivity extends AppCompatActivity
} else if (item instanceof Nameable>) {
Nameable> ni = (Nameable>) item;
switch (ni.getNameRes()) {
+ case R.string.subscriptions:
+ // TODO
+ break;
case R.string.settings:
startActivity(new Intent(MessageListActivity.this, SettingsActivity.class));
break;
@@ -176,10 +186,37 @@ public class MessageListActivity extends AppCompatActivity
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
+ this.menu = menu;
+ updateMenu();
+ return true;
+ }
+
+ private void updateMenu() {
boolean running = bmc.isRunning();
menu.findItem(R.id.sync_enabled).setVisible(running);
menu.findItem(R.id.sync_disabled).setVisible(!running);
- return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.sync_disabled:
+ bmc.startup(new BitmessageContext.Listener() {
+ @Override
+ public void receive(Plaintext plaintext) {
+ // TODO
+ Toast.makeText(MessageListActivity.this, plaintext.getSubject(), Toast.LENGTH_LONG).show();
+ }
+ });
+ updateMenu();
+ return true;
+ case R.id.sync_enabled:
+ bmc.shutdown();
+ updateMenu();
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
}
/**
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 f6d09d8..9bcf399 100644
--- a/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.java
+++ b/app/src/main/java/ch/dissem/apps/abit/MessageListFragment.java
@@ -1,6 +1,7 @@
package ch.dissem.apps.abit;
import android.app.Activity;
+import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.ListFragment;
@@ -9,8 +10,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
-import android.widget.TextView;
-import android.widget.Toast;
import ch.dissem.apps.abit.service.Singleton;
import ch.dissem.bitmessage.BitmessageContext;
import ch.dissem.bitmessage.entity.Plaintext;
@@ -97,7 +96,7 @@ public class MessageListFragment extends ListFragment {
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- Toast.makeText(MessageListFragment.this.getActivity(), "TODO", Toast.LENGTH_SHORT).show();
+ startActivity(new Intent(getActivity().getApplicationContext(), ComposeMessageActivity.class));
}
});
diff --git a/app/src/main/java/ch/dissem/apps/abit/OpenBitmessageLinkActivity.java b/app/src/main/java/ch/dissem/apps/abit/OpenBitmessageLinkActivity.java
new file mode 100644
index 0000000..cff4772
--- /dev/null
+++ b/app/src/main/java/ch/dissem/apps/abit/OpenBitmessageLinkActivity.java
@@ -0,0 +1,113 @@
+/*
+ * 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;
+
+import android.app.Activity;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Switch;
+import android.widget.TextView;
+import ch.dissem.apps.abit.service.Singleton;
+import ch.dissem.bitmessage.BitmessageContext;
+import ch.dissem.bitmessage.entity.BitmessageAddress;
+
+public class OpenBitmessageLinkActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_open_bitmessage_link);
+
+ final TextView addressView = (TextView) findViewById(R.id.address);
+ final EditText label = (EditText) findViewById(R.id.label);
+ final Switch importContact = (Switch) findViewById(R.id.import_contact);
+ final Switch subscribe = (Switch) findViewById(R.id.subscribe);
+
+ Uri uri = getIntent().getData();
+ final String address = getAddress(uri);
+ String[] parameters = getParameters(uri);
+ for (String parameter : parameters) {
+ String name = parameter.substring(0, 6).toLowerCase();
+ if (name.startsWith("label")) {
+ label.setText(parameter.substring(parameter.indexOf('=') + 1).trim());
+ } else if (name.startsWith("action")) {
+ parameter = parameter.toLowerCase();
+ importContact.setChecked(parameter.contains("add"));
+ subscribe.setChecked(parameter.contains("subscribe"));
+ }
+ }
+
+ addressView.setText(address);
+
+
+ final Button cancel = (Button) findViewById(R.id.cancel);
+ cancel.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ setResult(Activity.RESULT_CANCELED);
+ finish();
+ }
+ });
+ final Button ok = (Button) findViewById(R.id.do_import);
+ ok.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ BitmessageContext bmc = Singleton.getBitmessageContext(OpenBitmessageLinkActivity.this);
+ BitmessageAddress bmAddress = new BitmessageAddress(address);
+ bmAddress.setAlias(label.getText().toString());
+ if (subscribe.isChecked()) {
+ bmc.addSubscribtion(bmAddress);
+ }
+ if (importContact.isChecked()) {
+ bmc.addContact(bmAddress);
+ }
+ setResult(Activity.RESULT_OK);
+ finish();
+ }
+ });
+ }
+
+ private String getAddress(Uri uri) {
+ StringBuilder result = new StringBuilder();
+ String schemeSpecificPart = uri.getSchemeSpecificPart();
+ if (!schemeSpecificPart.startsWith("BM-")) {
+ result.append("BM-");
+ }
+ if (schemeSpecificPart.contains("?")) {
+ result.append(schemeSpecificPart.substring(0, schemeSpecificPart.indexOf('?')));
+ } else if (schemeSpecificPart.contains("#")) {
+ result.append(schemeSpecificPart.substring(0, schemeSpecificPart.indexOf('#')));
+ } else {
+ result.append(schemeSpecificPart);
+ }
+ return result.toString();
+ }
+
+ private String[] getParameters(Uri uri) {
+ int index = uri.getSchemeSpecificPart().indexOf('?');
+ if (index >= 0) {
+ String parameterPart = uri.getSchemeSpecificPart().substring(index + 1);
+ return parameterPart.split("&");
+ } else {
+ return new String[0];
+ }
+ }
+}
diff --git a/app/src/main/java/ch/dissem/apps/abit/SQLiteConfig.java b/app/src/main/java/ch/dissem/apps/abit/SQLiteConfig.java
deleted file mode 100644
index 6b230d2..0000000
--- a/app/src/main/java/ch/dissem/apps/abit/SQLiteConfig.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package ch.dissem.apps.abit;
-
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabase;
-import android.os.Environment;
-import ch.dissem.bitmessage.repository.JdbcConfig;
-import org.flywaydb.core.api.android.ContextHolder;
-import org.sqldroid.SQLDroidDriver;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.Properties;
-
-/**
- * Created by chris on 14.07.15.
- */
-public class SQLiteConfig extends JdbcConfig {
-
- public SQLiteConfig(Context ctx) {
- super(getDbUrl(ctx), "", "");
- }
-
- private static String getDbUrl(Context ctx) {
- SQLiteDatabase db = ctx.openOrCreateDatabase(Environment.getExternalStorageDirectory()
- + "/jabit.db", Context.MODE_PRIVATE, null);
- ContextHolder.setContext(ctx);
- return "jdbc:sqlite:" + db.getPath() + "?timeout=5";
- }
-
- @Override
- public Connection getConnection() throws SQLException {
- Properties removeLocale = new Properties();
- removeLocale.put(SQLDroidDriver.ADDITONAL_DATABASE_FLAGS, android.database.sqlite.SQLiteDatabase.NO_LOCALIZED_COLLATORS);
- return DriverManager.getConnection(dbUrl, removeLocale);
- }
-}
diff --git a/app/src/main/java/ch/dissem/apps/abit/repositories/AndroidInventory.java b/app/src/main/java/ch/dissem/apps/abit/repositories/AndroidInventory.java
new file mode 100644
index 0000000..80d9bdd
--- /dev/null
+++ b/app/src/main/java/ch/dissem/apps/abit/repositories/AndroidInventory.java
@@ -0,0 +1,7 @@
+package ch.dissem.apps.abit.repositories;
+
+/**
+ * Created by chris on 14.08.15.
+ */
+public class AndroidInventory {
+}
diff --git a/app/src/main/java/im/delight/android/identicons/Identicon.java b/app/src/main/java/im/delight/android/identicons/Identicon.java
deleted file mode 100644
index c419318..0000000
--- a/app/src/main/java/im/delight/android/identicons/Identicon.java
+++ /dev/null
@@ -1,213 +0,0 @@
-package im.delight.android.identicons;
-
-/**
- * Copyright 2014 www.delight.im
- *
- * 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 java.security.MessageDigest;
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.os.Build;
-import android.util.AttributeSet;
-import android.view.View;
-
-abstract public class Identicon extends View {
-
- private static final String HASH_ALGORITHM = "SHA-256";
- private final int mRowCount;
- private final int mColumnCount;
- private final Paint mPaint;
- private volatile int mCellWidth;
- private volatile int mCellHeight;
- private volatile byte[] mHash;
- private volatile int[][] mColors;
- private volatile boolean mReady;
-
- public Identicon(Context context) {
- super(context);
-
- mRowCount = getRowCount();
- mColumnCount = getColumnCount();
- mPaint = new Paint();
-
- init();
- }
-
- public Identicon(Context context, AttributeSet attrs) {
- super(context, attrs);
-
- mRowCount = getRowCount();
- mColumnCount = getColumnCount();
- mPaint = new Paint();
-
- init();
- }
-
- public Identicon(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
-
- mRowCount = getRowCount();
- mColumnCount = getColumnCount();
- mPaint = new Paint();
-
- init();
- }
-
- @SuppressLint("NewApi")
- protected void init() {
- mPaint.setStyle(Paint.Style.FILL);
- mPaint.setAntiAlias(true);
- mPaint.setDither(true);
-
- setWillNotDraw(false);
- if (Build.VERSION.SDK_INT >= 11) {
- setLayerType(View.LAYER_TYPE_SOFTWARE, null);
- }
- }
-
- public void show(String input) {
- // if the input was null
- if (input == null) {
- // we can't create a hash value and have nothing to show (draw to the view)
- mHash = null;
- }
- // if the input was a proper string (non-null)
- else {
- // generate a hash from the string to get unique but deterministic byte values
- try {
- final MessageDigest digest = java.security.MessageDigest.getInstance(HASH_ALGORITHM);
- digest.update(input == null ? new byte[0] : input.getBytes());
- mHash = digest.digest();
- }
- catch (Exception e) {
- mHash = null;
- }
- }
-
- // set up the cell colors according to the input that was provided via show(...)
- setupColors();
-
- // this view may now be drawn (and thus must be re-drawn)
- mReady = true;
- invalidate();
- }
-
- public void show(int input) {
- show(String.valueOf(input));
- }
-
- public void show(long input) {
- show(String.valueOf(input));
- }
-
- public void show(float input) {
- show(String.valueOf(input));
- }
-
- public void show(double input) {
- show(String.valueOf(input));
- }
-
- public void show(byte input) {
- show(String.valueOf(input));
- }
-
- public void show(char input) {
- show(String.valueOf(input));
- }
-
- public void show(boolean input) {
- show(String.valueOf(input));
- }
-
- public void show(Object input) {
- if (input == null) {
- mHash = null;
- }
- else {
- show(String.valueOf(input));
- }
- }
-
- protected void setupColors() {
- mColors = new int[mRowCount][mColumnCount];
- int colorVisible = getIconColor();
-
- for (int r = 0; r < mRowCount; r++) {
- for (int c = 0; c < mColumnCount; c++) {
- if (isCellVisible(r, c)) {
- mColors[r][c] = colorVisible;
- }
- else {
- mColors[r][c] = Color.TRANSPARENT;
- }
- }
- }
- }
-
- protected byte getByte(int index) {
- if (mHash == null) {
- return -128;
- }
- else {
- return mHash[index % mHash.length];
- }
- }
-
- abstract protected int getRowCount();
-
- abstract protected int getColumnCount();
-
- abstract protected boolean isCellVisible(int row, int column);
-
- abstract protected int getIconColor();
-
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
-
- mCellWidth = w / mColumnCount;
- mCellHeight = h / mRowCount;
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- int size = Math.min(getMeasuredWidth(), getMeasuredHeight());
- setMeasuredDimension(size, size);
- }
-
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- if (mReady) {
- int x, y;
- for (int r = 0; r < mRowCount; r++) {
- for (int c = 0; c < mColumnCount; c++) {
- x = mCellWidth * c;
- y = mCellHeight * r;
-
- mPaint.setColor(mColors[r][c]);
-
- canvas.drawRect(x, y + mCellHeight, x + mCellWidth, y, mPaint);
- }
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-hdpi/ic_action_close.png b/app/src/main/res/drawable-hdpi/ic_action_close.png
new file mode 100644
index 0000000..7031319
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_close.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_send.png b/app/src/main/res/drawable-hdpi/ic_action_send.png
new file mode 100644
index 0000000..e6c165d
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_send.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_fab_compose_message.png b/app/src/main/res/drawable-hdpi/ic_fab_compose_message.png
new file mode 100644
index 0000000..4c86788
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_fab_compose_message.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_plus_sign.png b/app/src/main/res/drawable-hdpi/ic_plus_sign.png
index b1fbbf8..54aef05 100755
Binary files a/app/src/main/res/drawable-hdpi/ic_plus_sign.png and b/app/src/main/res/drawable-hdpi/ic_plus_sign.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_close.png b/app/src/main/res/drawable-mdpi/ic_action_close.png
new file mode 100644
index 0000000..c71f1c4
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_close.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_send.png b/app/src/main/res/drawable-mdpi/ic_action_send.png
new file mode 100644
index 0000000..ca5ad5c
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_send.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_fab_compose_message.png b/app/src/main/res/drawable-mdpi/ic_fab_compose_message.png
new file mode 100644
index 0000000..ea4de02
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_fab_compose_message.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_plus_sign.png b/app/src/main/res/drawable-mdpi/ic_plus_sign.png
index 478b2c7..7284077 100755
Binary files a/app/src/main/res/drawable-mdpi/ic_plus_sign.png and b/app/src/main/res/drawable-mdpi/ic_plus_sign.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_close.png b/app/src/main/res/drawable-xhdpi/ic_action_close.png
new file mode 100644
index 0000000..2eb9589
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_close.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_send.png b/app/src/main/res/drawable-xhdpi/ic_action_send.png
new file mode 100644
index 0000000..04daa14
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_send.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_fab_compose_message.png b/app/src/main/res/drawable-xhdpi/ic_fab_compose_message.png
new file mode 100644
index 0000000..af0217a
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_fab_compose_message.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_plus_sign.png b/app/src/main/res/drawable-xhdpi/ic_plus_sign.png
index e94e813..d320ebf 100755
Binary files a/app/src/main/res/drawable-xhdpi/ic_plus_sign.png and b/app/src/main/res/drawable-xhdpi/ic_plus_sign.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_close.png b/app/src/main/res/drawable-xxhdpi/ic_action_close.png
new file mode 100644
index 0000000..76de2b1
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_close.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_send.png b/app/src/main/res/drawable-xxhdpi/ic_action_send.png
new file mode 100644
index 0000000..d36f994
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_send.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_fab_compose_message.png b/app/src/main/res/drawable-xxhdpi/ic_fab_compose_message.png
new file mode 100644
index 0000000..40ae82a
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_fab_compose_message.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_plus_sign.png b/app/src/main/res/drawable-xxhdpi/ic_plus_sign.png
index 8679166..24e567d 100755
Binary files a/app/src/main/res/drawable-xxhdpi/ic_plus_sign.png and b/app/src/main/res/drawable-xxhdpi/ic_plus_sign.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_plus_sign.png b/app/src/main/res/drawable-xxxhdpi/ic_plus_sign.png
index 1958de1..491d801 100755
Binary files a/app/src/main/res/drawable-xxxhdpi/ic_plus_sign.png and b/app/src/main/res/drawable-xxxhdpi/ic_plus_sign.png differ
diff --git a/app/src/main/res/layout/activity_open_bitmessage_link.xml b/app/src/main/res/layout/activity_open_bitmessage_link.xml
new file mode 100644
index 0000000..e1ebd08
--- /dev/null
+++ b/app/src/main/res/layout/activity_open_bitmessage_link.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_compose_message.xml b/app/src/main/res/layout/fragment_compose_message.xml
new file mode 100644
index 0000000..e3e0887
--- /dev/null
+++ b/app/src/main/res/layout/fragment_compose_message.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_message_list.xml b/app/src/main/res/layout/fragment_message_list.xml
index 26a3a1b..6e7982b 100644
--- a/app/src/main/res/layout/fragment_message_list.xml
+++ b/app/src/main/res/layout/fragment_message_list.xml
@@ -2,7 +2,8 @@
+ android:layout_height="match_parent"
+ xmlns:fab="http://schemas.android.com/tools">
-
-
-
+
-
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_below="@id/toolbar"
+ android:id="@+id/content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context=".MessageListActivity"
+ tools:layout="@android:layout/list_content"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/compose.xml b/app/src/main/res/menu/compose.xml
new file mode 100644
index 0000000..ee25c89
--- /dev/null
+++ b/app/src/main/res/menu/compose.xml
@@ -0,0 +1,9 @@
+
+
\ 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 da48d07..c6de80a 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -4,4 +4,14 @@
Einstellungen
Nur WLAN
Nicht mit Mobilfunknetz verbinden
+ Bitmessage ist aktiv
+ Synchronisieren ausschalten
+ Eingabe von Emojis
+ Emoji-Taste anstelle von Eingabe anzeigen
+ Synchronisieren einschalten
+ Betreff
+ An
+ Nachricht
+ Abonnements
+ Art der WLAN-Verbindung
\ No newline at end of file
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..b4f5f3c
--- /dev/null
+++ b/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,22 @@
+
+
+
+
+ 64dp
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 42d7392..8cbeca3 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,12 +1,12 @@
- #607D8B
- #455A64
- #CFD8DC
- #FF9800
+ #FFC107
+ #FFA000
+ #FFECB3
+ #607D8B
#212121
#727272
- #FFFFFF
+ #212121
#B6B6B6
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..5d61d98
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,21 @@
+
+
+
+
+ 16dp
+ 16dp
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 68e30b8..20ad459 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -8,4 +8,22 @@
Settings
Wi-Fi only
Don\'t connect to the mobile network
+ Subscriptions
+ To
+ Subject
+ Emoji Input
+ Show the emoji button instead of enter
+ Manage Identity
+ Add Identity
+ Create new identity
+ Import Contact
+
+ Hello world!
+ Settings
+ Import Address
+ Add to contacts
+ Label
+ Subscribe
+ Import
+ Cancel