[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:
parent
846ea7be39
commit
1e20c8ebcc
@ -23,7 +23,9 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".view.SettingsActivity" />
|
<activity android:name=".view.SettingsActivity" />
|
||||||
<activity android:name=".view.AboutActivity" />
|
<activity android:name=".view.AboutActivity" />
|
||||||
<activity android:name=".view.DetailActivity" />
|
<activity
|
||||||
|
android:name=".view.DetailActivity"
|
||||||
|
android:theme="@style/ItemActivityTheme"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".view.SearchableActivity"
|
android:name=".view.SearchableActivity"
|
||||||
android:label="Поиск"
|
android:label="Поиск"
|
||||||
|
@ -2,6 +2,7 @@ package ru.volgorobot.vrcatalog.view;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.design.widget.TabLayout;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
@ -35,6 +36,7 @@ public class DetailActivity extends AppCompatActivity implements MainContract.It
|
|||||||
setContentView(R.layout.activity_detail);
|
setContentView(R.layout.activity_detail);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setHomeButtonEnabled(true);
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
|
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||||
initializeViews();
|
initializeViews();
|
||||||
mPresenter = new ItemPresenter(DetailActivity.this, this);
|
mPresenter = new ItemPresenter(DetailActivity.this, this);
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
@ -43,6 +45,8 @@ public class DetailActivity extends AppCompatActivity implements MainContract.It
|
|||||||
String tmp = intent.getStringExtra("detailPrice");
|
String tmp = intent.getStringExtra("detailPrice");
|
||||||
if(tmp.equals("0")) {
|
if(tmp.equals("0")) {
|
||||||
tmp = "Уточните у продавца";
|
tmp = "Уточните у продавца";
|
||||||
|
} else {
|
||||||
|
tmp = tmp + " \u20BD";
|
||||||
}
|
}
|
||||||
((TextView) findViewById(R.id.itemPrice)).setText(tmp);
|
((TextView) findViewById(R.id.itemPrice)).setText(tmp);
|
||||||
|
|
||||||
@ -132,7 +136,9 @@ public class DetailActivity extends AppCompatActivity implements MainContract.It
|
|||||||
@Override
|
@Override
|
||||||
public void setViewPagerContent(String[] uris) {
|
public void setViewPagerContent(String[] uris) {
|
||||||
ImagePagerAdapter imagePagerAdapter = new ImagePagerAdapter(DetailActivity.this, uris);
|
ImagePagerAdapter imagePagerAdapter = new ImagePagerAdapter(DetailActivity.this, uris);
|
||||||
|
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabDots);
|
||||||
viewPager.setAdapter(imagePagerAdapter);
|
viewPager.setAdapter(imagePagerAdapter);
|
||||||
|
tabLayout.setupWithViewPager(viewPager);
|
||||||
imagePagerAdapter.notifyDataSetChanged();
|
imagePagerAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
app/src/main/res/drawable/tab_indicator_default.xml
Normal file
8
app/src/main/res/drawable/tab_indicator_default.xml
Normal 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>
|
9
app/src/main/res/drawable/tab_indicator_selected.xml
Normal file
9
app/src/main/res/drawable/tab_indicator_selected.xml
Normal 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>
|
8
app/src/main/res/drawable/tab_selector.xml
Normal file
8
app/src/main/res/drawable/tab_selector.xml
Normal 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>
|
@ -1,33 +1,54 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<android.support.v4.view.ViewPager
|
<LinearLayout
|
||||||
android:id="@+id/viewPager"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="313dp" />
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<android.support.v4.view.ViewPager
|
||||||
android:id="@+id/itemName"
|
android:id="@+id/viewPager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="40dp"
|
android:layout_height="313dp" />
|
||||||
android:text="Item Name"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:textSize="30sp" />
|
|
||||||
|
|
||||||
<TextView
|
<android.support.design.widget.TabLayout
|
||||||
android:id="@+id/itemPrice"
|
android:id="@+id/tabDots"
|
||||||
android:layout_width="match_parent"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:text="Item Price"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
app:tabBackground="@drawable/tab_selector"
|
||||||
android:textSize="24sp" />
|
app:tabGravity="center"
|
||||||
<ListView
|
app:tabIndicatorHeight="0dp"/>
|
||||||
android:id="@+id/propertiesList"
|
|
||||||
android:layout_width="match_parent"
|
<TextView
|
||||||
android:layout_height="wrap_content"/>
|
android:id="@+id/itemName"
|
||||||
</LinearLayout>
|
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>
|
@ -9,11 +9,13 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Property Name"
|
android:text="Property Name"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp"
|
||||||
|
android:layout_marginLeft="9dp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/propertyValueView"
|
android:id="@+id/propertyValueView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Property Value" />
|
android:text="Property Value"
|
||||||
|
android:layout_marginLeft="9dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -5,4 +5,16 @@
|
|||||||
<item name="windowNoTitle">true</item>
|
<item name="windowNoTitle">true</item>
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
</style>
|
</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>
|
</resources>
|
||||||
|
@ -17,4 +17,8 @@
|
|||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||||
|
|
||||||
|
<style name="ItemActivityTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
|
<item name="android:windowTranslucentStatus">true</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user