[DetailActivity] Made transparent toolbar, dots (which indicates, how many images in slider), margin 9 dp from the left and char "Р" in price.

This commit is contained in:
ChronosX88 2019-02-09 21:45:22 +04:00
parent 846ea7be39
commit 1e20c8ebcc
No known key found for this signature in database
GPG Key ID: 8F92E090A87804AA
9 changed files with 101 additions and 29 deletions

View File

@ -23,7 +23,9 @@
</activity>
<activity android:name=".view.SettingsActivity" />
<activity android:name=".view.AboutActivity" />
<activity android:name=".view.DetailActivity" />
<activity
android:name=".view.DetailActivity"
android:theme="@style/ItemActivityTheme"/>
<activity
android:name=".view.SearchableActivity"
android:label="Поиск"

View File

@ -2,6 +2,7 @@ package ru.volgorobot.vrcatalog.view;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.text.method.LinkMovementMethod;
@ -35,6 +36,7 @@ public class DetailActivity extends AppCompatActivity implements MainContract.It
setContentView(R.layout.activity_detail);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(false);
initializeViews();
mPresenter = new ItemPresenter(DetailActivity.this, this);
Intent intent = getIntent();
@ -43,6 +45,8 @@ public class DetailActivity extends AppCompatActivity implements MainContract.It
String tmp = intent.getStringExtra("detailPrice");
if(tmp.equals("0")) {
tmp = "Уточните у продавца";
} else {
tmp = tmp + " \u20BD";
}
((TextView) findViewById(R.id.itemPrice)).setText(tmp);
@ -132,7 +136,9 @@ public class DetailActivity extends AppCompatActivity implements MainContract.It
@Override
public void setViewPagerContent(String[] uris) {
ImagePagerAdapter imagePagerAdapter = new ImagePagerAdapter(DetailActivity.this, uris);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabDots);
viewPager.setAdapter(imagePagerAdapter);
tabLayout.setupWithViewPager(viewPager);
imagePagerAdapter.notifyDataSetChanged();
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="0dp"
android:shape="ring"
android:thickness="2dp"
android:useLevel="false">
<solid android:color="@android:color/darker_gray"/>
</shape>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
android:innerRadius="0dp"
android:shape="ring"
android:thickness="4dp"
android:useLevel="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorAccent"/>
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/tab_indicator_selected"
android:state_selected="true"/>
<item android:drawable="@drawable/tab_indicator_default"/>
</selector>

View File

@ -1,33 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_height="wrap_content">
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="wrap_content"
android:layout_height="313dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/itemName"
android:layout_width="match_parent"
android:layout_height="40dp"
android:text="Item Name"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="30sp" />
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="wrap_content"
android:layout_height="313dp" />
<TextView
android:id="@+id/itemPrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Item Price"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="24sp" />
<ListView
android:id="@+id/propertiesList"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tabDots"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="@drawable/tab_selector"
app:tabGravity="center"
app:tabIndicatorHeight="0dp"/>
<TextView
android:id="@+id/itemName"
android:layout_width="match_parent"
android:layout_height="40dp"
android:text="Item Name"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="30sp"
android:layout_marginLeft="9dp"/>
<TextView
android:id="@+id/itemPrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Item Price"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="24sp"
android:layout_marginLeft="9dp"/>
<ListView
android:id="@+id/propertiesList"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>

View File

@ -9,11 +9,13 @@
android:layout_height="wrap_content"
android:text="Property Name"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
android:textSize="18sp"
android:layout_marginLeft="9dp"/>
<TextView
android:id="@+id/propertyValueView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Property Value" />
android:text="Property Value"
android:layout_marginLeft="9dp"/>
</LinearLayout>

View File

@ -5,4 +5,16 @@
<item name="windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="ItemActivityTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="colorPrimary">@android:color/transparent</item>
<item name="actionBarStyle">@style/MyActionBar</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
<style name="MyActionBar" parent="Widget.AppCompat.ActionBar.Solid">
<item name="android:background">@android:color/transparent</item>
<!--For compatibility-->
<item name="background">@android:color/transparent</item>
</style>
</resources>

View File

@ -17,4 +17,8 @@
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="ItemActivityTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowTranslucentStatus">true</item>
</style>
</resources>