Commit 09d1f09c by Paktalin

main activity done

parent e3f4b3f3
...@@ -4,9 +4,7 @@ import android.content.Intent; ...@@ -4,9 +4,7 @@ import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView; import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar;
import android.support.v4.view.GravityCompat; import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.ActionBarDrawerToggle;
...@@ -14,7 +12,6 @@ import android.support.v7.app.AppCompatActivity; ...@@ -14,7 +12,6 @@ import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.widget.ListView; import android.widget.ListView;
public class MainActivity extends AppCompatActivity public class MainActivity extends AppCompatActivity
...@@ -44,15 +41,6 @@ public class MainActivity extends AppCompatActivity ...@@ -44,15 +41,6 @@ public class MainActivity extends AppCompatActivity
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
......
<?xml version="1.0" encoding="utf-8"?>
<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="match_parent"
tools:context="com.example.paktalin.lavina.MainActivity"
android:background="@drawable/red_background">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
android:background="@android:color/transparent"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
<Button
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_gravity="bottom|end"
android:background="@drawable/wine_button"
android:layout_margin="@dimen/fab_margin"/>
</android.support.design.widget.CoordinatorLayout>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<ImageView <ImageView
android:id="@+id/image_logo" android:id="@+id/image_logo"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="95dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_margin="30dp" android:layout_margin="30dp"
android:background="@drawable/logo" /> android:background="@drawable/logo" />
......
...@@ -25,13 +25,11 @@ ...@@ -25,13 +25,11 @@
<include layout="@layout/content_main" /> <include layout="@layout/content_main" />
<android.support.design.widget.FloatingActionButton <Button
android:id="@+id/fab" android:layout_width="55dp"
android:layout_width="wrap_content" android:layout_height="55dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
app:backgroundTint="@color/colorPrimary" android:background="@drawable/wine_button"
app:srcCompat="@drawable/wine_icon" android:layout_margin="@dimen/fab_margin"/>
android:layout_margin="@dimen/fab_margin" />
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>
...@@ -15,12 +15,10 @@ ...@@ -15,12 +15,10 @@
<TextView <TextView
android:id="@+id/wine_title" android:id="@+id/wine_title"
android:layout_width="wrap_content" android:layout_width="180dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Two gates 2012"
android:textColor="@color/colorPrimaryDark" android:textColor="@color/colorPrimaryDark"
android:textSize="16sp" android:textSize="14sp"
android:textStyle="bold|italic"
android:layout_marginLeft="20dp" /> android:layout_marginLeft="20dp" />
<TextView <TextView
...@@ -28,42 +26,28 @@ ...@@ -28,42 +26,28 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/wine_title" android:layout_below="@+id/wine_title"
android:textColor="@color/colorPrimaryDark" android:textColor="@color/colorPrimary"
android:textStyle="bold|italic" android:layout_marginTop="5dp"
android:text="Chardonnay" android:textStyle="bold"
android:textSize="16sp" android:textSize="20sp"
android:layout_alignLeft="@+id/wine_title" /> android:layout_alignLeft="@+id/wine_title" />
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
android:id="@+id/wine_image" android:id="@+id/wine_image"
android:layout_width="30dp" android:layout_width="80dp"
android:layout_height="80dp" android:layout_height="80dp"
android:background="@drawable/wine1" android:layout_centerVertical="true" />
android:layout_marginStart="10dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp" />
<TextView
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/arrow"
android:text="182 €"
android:textSize="25sp"
android:textStyle="italic"
android:layout_centerVertical="true"
android:layout_marginEnd="20dp"/>
<ImageButton <ImageButton
android:id="@+id/arrow" android:id="@+id/arrow"
android:layout_width="13dp" android:layout_width="35dp"
android:layout_height="22dp" android:layout_height="35dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="20dp" android:layout_marginEnd="10dp"
android:background="@drawable/arrow_right" android:background="@drawable/order_button3"
android:layout_marginRight="30dp" android:layout_marginRight="30dp"
android:layout_alignParentRight="true" /> android:layout_alignParentRight="true" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#C41E32</color> <color name="colorPrimary">#d80001</color>
<color name="colorPrimaryDark">#4E0707</color> <color name="colorPrimaryDark">#4E0707</color>
<color name="colorAccent">#000</color> <color name="colorAccent">#000</color>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment