This commit is contained in:
Yaroslav Berezanskyi 2015-08-25 20:14:42 +03:00
commit e154aa83dd
4 changed files with 14 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
@ -95,7 +96,7 @@ public abstract class BaseActivity extends AppCompatActivity implements
if (toolbar != null) {
setSupportActionBar(toolbar);
mDrawerLayout.setStatusBarBackgroundColor(getColor(android.R.color.black));
mDrawerLayout.setStatusBarBackgroundColor(ContextCompat.getColor(this, android.R.color.black));
}
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar,

View File

@ -19,9 +19,7 @@ import java.util.List;
import io.syng.R;
import io.syng.entity.Profile;
import io.syng.util.GeneralUtil;
import io.syng.util.PrefsUtil;
import io.syng.util.ProfileManager;
import io.syng.util.*;
import static org.ethereum.config.SystemProperties.CONFIG;

View File

@ -75,6 +75,16 @@ public class Profile implements Serializable {
return privateKeys;
}
public List<String> getAddresses() {
List<String> addresses = new ArrayList<>();
for (String privateKey: privateKeys) {
ECKey key = ECKey.fromPrivate(Hex.decode(privateKey));
addresses.add(Hex.toHexString(key.getAddress()));
}
return addresses;
}
public void setPrivateKeys(List<String> privateKeys) {
this.privateKeys = privateKeys;
}

View File

@ -50,7 +50,7 @@ public class ProfileKeysFragment extends Fragment {
mRecyclerView = (RecyclerView) view.findViewById(R.id.rv_profile_keys);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(layoutManager);
mProfileDrawerAdapter = new ProfileKeyAdapter(profile.getPrivateKeys());
mProfileDrawerAdapter = new ProfileKeyAdapter(profile.getAddresses());
mRecyclerView.setAdapter(mProfileDrawerAdapter);
return view;