Watchlist infalter
This commit is contained in:
parent
76e299355d
commit
defd3db2f0
@ -28,6 +28,7 @@ import android.text.style.StyleSpan;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.DragEvent;
|
import android.view.DragEvent;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
@ -58,6 +59,8 @@ import com.nauk.coinfolio.DataManagers.PreferencesManager;
|
|||||||
import com.nauk.coinfolio.LayoutManagers.HomeLayoutGenerator;
|
import com.nauk.coinfolio.LayoutManagers.HomeLayoutGenerator;
|
||||||
import com.nauk.coinfolio.R;
|
import com.nauk.coinfolio.R;
|
||||||
|
|
||||||
|
import org.w3c.dom.Text;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
@ -373,6 +376,23 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
|
|
||||||
|
View view = LayoutInflater.from(this).inflate(R.layout.cardview_watchlist, null);
|
||||||
|
((TextView) view.findViewById(R.id.currencyFluctuationPercentageTextView)).setText("3%");
|
||||||
|
((TextView) view.findViewById(R.id.currencyFluctuationTextView)).setText("$3");
|
||||||
|
((TextView) view.findViewById(R.id.currencyNameTextView)).setText("TanguyCoin");
|
||||||
|
((TextView) view.findViewById(R.id.currencySymbolTextView)).setText("TGC");
|
||||||
|
((TextView) view.findViewById(R.id.currencyValueTextView)).setText("$100");
|
||||||
|
view.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||||
|
view.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Log.d("coinfolio", "Clicked !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
((LinearLayout) findViewById(R.id.linearLayoutWatchlist)).addView(view);
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
|
|
||||||
updateAll(intent.getBooleanExtra("update", false));
|
updateAll(intent.getBooleanExtra("update", false));
|
||||||
|
173
app/src/main/res/layout/cardview_watchlist.xml
Normal file
173
app/src/main/res/layout/cardview_watchlist.xml
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:backgroundTint="@color/listBackground2"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/mainLinear"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clickable="false"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:tag="mainLinear">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/currencyInfoLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/topLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/currencyIcon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="1dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/currencyNameTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textColor="@color/mainTextViewColor"
|
||||||
|
android:textSize="@dimen/cardViewMainText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/currencySymbolTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:textColor="@color/secondaryTextViewColor"
|
||||||
|
android:textSize="@dimen/cardViewSecondaryText" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/bottomLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/currencyValueTextView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textColor="@color/secondaryTextViewColor"
|
||||||
|
android:textSize="@dimen/cardViewMainText"
|
||||||
|
android:layout_weight="0.5"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/secondaryLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_weight="0.5">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/currencyFluctuationPercentageTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/cardViewMainText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/currencyFluctuationTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/cardViewSecondaryText" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/separationLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Day history"
|
||||||
|
android:textSize="@dimen/cardViewSecondaryText" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:background="@color/separationLine" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/frameLayoutChart"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/cardViewChartSize"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<!--<com.db.chart.view.LineChartView
|
||||||
|
android:id="@+id/LineChartView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/cardViewChartSize"
|
||||||
|
android:visibility="gone" />-->
|
||||||
|
|
||||||
|
<com.github.mikephil.charting.charts.LineChart
|
||||||
|
android:id="@+id/LineChartView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/errorTextView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/cardViewChartSize"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Error"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/detailsArrow"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_keyboard_arrow_right_grey_48dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_gravity="center_vertical|end"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user