Added others details

This commit is contained in:
ChronosX88 2019-01-05 18:21:20 +04:00
parent e7795ca4c5
commit 37fdf104d5
No known key found for this signature in database
GPG Key ID: 8F92E090A87804AA
3 changed files with 97 additions and 15 deletions

View File

@ -75,6 +75,9 @@ public class ThirdLevelNodeViewBinder extends BaseNodeViewBinder {
intent.putExtra("detailName", result.getData().getName());
intent.putExtra("detailQuantity", result.getData().getNumber().toString());
intent.putExtra("detailPrice", result.getData().getPrice());
intent.putExtra("detailContry", result.getData().getCountry());
intent.putExtra("detailAnalogue", result.getData().getAnalogue());
intent.putExtra("detailDatasheet", result.getData().getDocURL());
intent.putExtra("detailNotes", result.getData().getNotes());
mView.startActivityByIntent(intent);
break;

View File

@ -3,6 +3,7 @@ package ru.volgorobot.vrcatalog.view;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.TextView;
@ -13,6 +14,9 @@ public class DetailActivity extends AppCompatActivity {
TextView nameView;
TextView quantityView;
TextView priceView;
TextView countryView;
TextView analogueView;
TextView datasheetView;
EditText notesView;
@Override
@ -26,9 +30,12 @@ public class DetailActivity extends AppCompatActivity {
Intent intent = getIntent();
nameView.setText(intent.getStringExtra("detailName"));
quantityView.setText(intent.getStringExtra("detailQuantity"));
quantityView.setText(intent.getStringExtra("detailQuantity").equals("0") ? "Нет на складе" : intent.getStringExtra("detailQuantity"));
priceView.setText(intent.getStringExtra("detailPrice"));
notesView.setText(intent.getStringExtra("detailNotes"));
countryView.setText(intent.getStringExtra("detailCountry"));
analogueView.setText(intent.getStringExtra("detailAnalogue").equals("") ? "Нет аналогов" : intent.getStringExtra("detailAnalogue"));
datasheetView.setText(intent.getStringExtra("detailDatasheet").equals(" ") ? "Нет" : intent.getStringExtra("detailDatasheet"));
notesView.setText(intent.getStringExtra("detailNotes").equals("") ? "Нет описания" : intent.getStringExtra("detailNotes"));
}
void initializeViews() {
@ -36,6 +43,10 @@ public class DetailActivity extends AppCompatActivity {
quantityView = findViewById(R.id.quantity);
priceView = findViewById(R.id.price);
notesView = findViewById(R.id.notes);
countryView = findViewById(R.id.country);
analogueView = findViewById(R.id.analogue);
datasheetView = findViewById(R.id.datasheet);
datasheetView.setMovementMethod(LinkMovementMethod.getInstance());
}
@Override

View File

@ -29,11 +29,11 @@
android:id="@+id/notes_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:layout_marginTop="172dp"
android:text="Описание: "
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toStartOf="@+id/price_text"
app:layout_constraintTop_toBottomOf="@+id/price_text" />
app:layout_constraintStart_toStartOf="@+id/notes"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/quantity_text"
@ -47,23 +47,29 @@
<TextView
android:id="@+id/quantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:layout_height="19dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="@+id/price"
app:layout_constraintStart_toEndOf="@+id/quantity_text"
app:layout_constraintTop_toBottomOf="@+id/name" />
app:layout_constraintTop_toTopOf="@+id/name" />
<EditText
android:id="@+id/notes"
android:layout_width="286dp"
android:layout_width="0dp"
android:layout_height="99dp"
android:layout_marginTop="3dp"
android:layout_marginStart="16dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="16dp"
android:ems="10"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="textMultiLine"
app:layout_constraintStart_toStartOf="@+id/notes_text"
app:layout_constraintTop_toBottomOf="@+id/notes_text">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/notes_text">
<requestFocus />
</EditText>
@ -80,8 +86,70 @@
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:layout_marginBottom="11dp"
android:text="TextView"
app:layout_constraintStart_toEndOf="@+id/price_text"
app:layout_constraintTop_toBottomOf="@+id/quantity_text" />
app:layout_constraintBottom_toTopOf="@+id/country_text"
app:layout_constraintStart_toEndOf="@+id/price_text" />
<TextView
android:id="@+id/country_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Страна изготовления: "
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintBaseline_toBaselineOf="@+id/country"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/country"
android:layout_width="wrap_content"
android:layout_height="19dp"
android:layout_marginTop="86dp"
android:layout_marginBottom="86dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="@+id/notes_text"
app:layout_constraintStart_toEndOf="@+id/country_text"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/analogue_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Аналоги: "
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintBaseline_toBaselineOf="@+id/analogue"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/analogue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="9dp"
android:text="TextView"
app:layout_constraintStart_toEndOf="@+id/analogue_text"
app:layout_constraintTop_toBottomOf="@+id/country_text" />
<TextView
android:id="@+id/datasheet_text"
android:layout_width="wrap_content"
android:layout_height="19dp"
android:layout_marginStart="16dp"
android:text="Техническая спецификация: "
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintBaseline_toBaselineOf="@+id/datasheet"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/datasheet"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_marginTop="128dp"
android:layout_marginBottom="127dp"
android:autoLink="web"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="@+id/notes"
app:layout_constraintStart_toEndOf="@+id/datasheet_text"
app:layout_constraintTop_toTopOf="@+id/name" />
</android.support.constraint.ConstraintLayout>