-Create class LoadingActivity.kt

-Create loading_activity.xml layout
-Static interface integración in LoadingActivity.kt to entable simple use
-In the Board Window in the server connection show the new loading acitivity
-Take video called “Loading screen when socket server comunicación comes”
-In the Intro Window: When the user tríes to clic button and there are not server comunication it should show loading screen
-In the board window i tested that the gestores GUI works fine in real device
-In the BoardActivity there is a grey brand below first panel gui balances
-Change the Font in the BoardAcivity to be the same as in the video
-In the BoardActivity when clicling in sections that the sections show grayed for unselected and White for selected
-Change Bitshares Font style as the video
-In the window BroadActivity set the left icon more mall and the Font as in the video
master
dtvv 2018-08-17 00:43:03 -05:00
parent f9995bf284
commit 119300d545
9 changed files with 108 additions and 6 deletions

View File

@ -33,6 +33,9 @@
</activity>
<activity android:name=".activities.CreateSeedActivity" >
</activity>
<activity android:name=".activities.LoadingActivity"
android:theme="@style/ActivityDialog">
</activity>
<activity android:name=".activities.AccountSeedsManagementActivity" >
</activity>
<activity android:name=".activities.ImportSeedActivity" >

View File

@ -8,6 +8,8 @@ import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Typeface;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
@ -19,12 +21,19 @@ import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.Pair;
import android.util.TypedValue;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.sjaramillo10.animatedtablayout.AnimatedTabLayout;
@ -47,7 +56,7 @@ import cy.agorise.crystalwallet.viewmodels.CryptoNetBalanceListViewModel;
*
*/
public class BoardActivity extends AppCompatActivity {
public class BoardActivity extends CustomActivity {
@BindView(R.id.tabLayout)
public TabLayout tabLayout;
@ -98,6 +107,54 @@ public class BoardActivity extends AppCompatActivity {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
/*
* Listener tabLayout to resalt text when clicked
* */
final TabLayout tabLayoutFinal = tabLayout;
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(final TabLayout.Tab tab) {
globalActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
LinearLayout tabLayout = (LinearLayout)((ViewGroup) tabLayoutFinal.getChildAt(0)).getChildAt(tab.getPosition());
TextView tabTextView = (TextView) tabLayout.getChildAt(1);
//tabTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP ,50);
Spannable WordtoSpan = new SpannableString(tabTextView.getText());
WordtoSpan.setSpan(new ForegroundColorSpan(Color.WHITE), 0, tabTextView.getText().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
tabTextView.setText(WordtoSpan);
tabTextView.setTypeface(tabTextView.getTypeface(), Typeface.BOLD);
}
});
}
@Override
public void onTabUnselected(final TabLayout.Tab tab) {
globalActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
LinearLayout tabLayout = (LinearLayout)((ViewGroup) tabLayoutFinal.getChildAt(0)).getChildAt(tab.getPosition());
TextView tabTextView = (TextView) tabLayout.getChildAt(1);
//tabTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP ,50);
Spannable WordtoSpan = new SpannableString(tabTextView.getText());
WordtoSpan.setSpan(new ForegroundColorSpan(globalActivity.getResources().getColor(R.color.whiteclear)), 0, tabTextView.getText().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
tabTextView.setText(WordtoSpan);
tabTextView.setTypeface(tabTextView.getTypeface(), Typeface.NORMAL);
}
});
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
// Appbar animation
mSurfaceView.getHolder().addCallback(new SurfaceHolder.Callback() {
@Override

View File

@ -63,8 +63,6 @@ public class IntroActivity extends CustomActivity {
ButterKnife.bind(this);
/*
* Test connection with server
* */

View File

@ -12,6 +12,7 @@ import com.neovisionaries.ws.client.WebSocketListener;
import java.io.IOException;
import java.util.HashMap;
import cy.agorise.crystalwallet.activities.LoadingActivity;
import cy.agorise.crystalwallet.apigenerator.GrapheneApiGenerator;
import cy.agorise.crystalwallet.dialogs.material.DialogMaterial;
@ -157,6 +158,13 @@ public class WebSocketThread extends Thread {
canChange = false;
/*
* Show the loading activity so user can see the progress
* */
if(activity!=null){
LoadingActivity.show(activity);
}
// Moves the current Thread into the background
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
@ -174,6 +182,13 @@ public class WebSocketThread extends Thread {
WebSocketThread.currentThreads.put(this.getId(),this);
mWebSocket.connect();
/*
* Hide the loading activity, now it is not more necesary
* */
if(activity!=null){
LoadingActivity.dismiss();
}
/*
*
* Websocket success response
@ -185,6 +200,11 @@ public class WebSocketThread extends Thread {
} catch (final Exception e) {
Log.e(TAG, "WebSocketException. Msg: "+e.getMessage());
/*
* Hide the loading activity, now it is not more necesary
* */
LoadingActivity.dismiss();
//Deliver error to user
if(activity!=null){

View File

@ -192,7 +192,14 @@ public class CryptoNetBalanceViewHolder extends RecyclerView.ViewHolder {
} else {
final CryptoNetBalanceViewHolder thisViewHolder = this;
this.cryptoNetAccountId = balance.getAccountId();
cryptoNetName.setText(balance.getCryptoNet().getLabel());
/*
* The first letter should be in mayus
* */
final String crypto = balance.getCryptoNet().getLabel().toString().toLowerCase();
final String upperString = crypto.substring(0,1).toUpperCase() + crypto.substring(1);
cryptoNetName.setText(upperString);
//Loads the crypto coin balance list of this account using a ViewModel and retrieving a LiveData List
CryptoCoinBalanceListViewModel cryptoCoinBalanceListViewModel = ViewModelProviders.of(this.fragment).get(CryptoCoinBalanceListViewModel.class);

View File

@ -25,8 +25,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:maxHeight="32dp"
android:maxWidth="32dp"
android:maxHeight="28dp"
android:maxWidth="28dp"
app:srcCompat="@drawable/bts" />
<TextView
@ -34,6 +34,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_toRightOf="@id/ivCryptoNetIcon"
android:ems="10"
android:text="unknown coin" />

View File

@ -101,7 +101,10 @@
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabSelectedTextColor="@color/white"
app:layout_collapseMode="pin"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabTextColor="@color/whiteclear"
android:animateLayoutChanges="true" />
</android.support.design.widget.CollapsingToolbarLayout>

View File

@ -4,9 +4,19 @@
android:layout_height="match_parent"
tools:context="cy.agorise.crystalwallet.fragments.BalanceFragment">
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_gravity="start"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#d9d9d9"
android:animateLayoutChanges="true" />
<cy.agorise.crystalwallet.views.CryptoNetBalanceListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/vCryptoNetBalanceListView" />
</FrameLayout>

View File

@ -14,6 +14,9 @@
<color name="green">#147b00</color>
<color name="whiteclear">#cccccc</color>
<color name="black">#000000</color>
<color name="greencolor">#70882E</color>
<color name="red">#ff0000</color>