Skip to content

Commit

Permalink
bætti takkana og setti bakgrunn á rate_fragment takkan
Browse files Browse the repository at this point in the history
  • Loading branch information
helgifr committed Apr 18, 2018
1 parent fdf381d commit b5f93ee
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ public void onClick(View view) {
for (int j = 0; j < schedules.length(); j++) {
Button schedule = new Button(getContext());
schedule.setText(schedules.getJSONObject(j).getString("time"));
schedule.setTextSize(13);
addUrlToBtn(schedule, schedules.getJSONObject(j).getString("purchase_url"));
schedule.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.showtime_button_background));
FlowLayout.LayoutParams scheduleLayout = new FlowLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
Expand Down
113 changes: 86 additions & 27 deletions app/src/main/res/drawable/button_background.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners
android:radius="100dp"
/>
<gradient
android:angle="45"
android:centerX="35%"
android:centerColor="#0858A8"
android:startColor="#452CE8"
android:endColor="#14A9FF"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<size
android:width="270dp"
android:height="60dp"
/>
<stroke
android:width="1dp"
android:color="#b1a9a9"
/>
</shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">

<item android:state_pressed="true">

<shape>
<corners
android:radius="100dp"
/>
<gradient
android:angle="45"
android:centerX="35%"
android:centerColor="#7ba808"
android:startColor="#2ce8e8"
android:endColor="#14ff7e"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="1dp"
android:color="#b1a9a9"
/>
</shape>

</item>

<item android:state_focused="true">

<shape>
<corners
android:radius="100dp"
/>
<gradient
android:angle="45"
android:centerX="35%"
android:centerColor="#7ba808"
android:startColor="#2ce8e8"
android:endColor="#14ff7e"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="1dp"
android:color="#b1a9a9"
/>
</shape>

</item>

<item>
<shape>
<corners
android:radius="100dp"
/>
<gradient
android:angle="45"
android:centerX="35%"
android:centerColor="#0858A8"
android:startColor="#452CE8"
android:endColor="#14A9FF"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="1dp"
android:color="#b1a9a9"
/>
</shape>

</item>

</selector>
102 changes: 81 additions & 21 deletions app/src/main/res/drawable/showtime_button_background.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners
android:radius="100dp"
/>
<gradient
android:angle="45"
android:startColor="#5f50b6"
android:endColor="#ca1f47"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="2dp"
android:color="#b7569e"
/>
</shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">

<item android:state_pressed="true">

<shape>
<corners
android:radius="100dp"
/>
<gradient
android:angle="45"
android:startColor="#4f1fca"
android:endColor="#d42a6e"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="2dp"
android:color="#b7569e"
/>
</shape>

</item>

<item android:state_focused="true">

<shape>
<corners
android:radius="100dp"
/>
<gradient
android:angle="45"
android:startColor="#4f1fca"
android:endColor="#d42a6e"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="2dp"
android:color="#b7569e"
/>
</shape>

</item>

<item>

<shape>
<corners
android:radius="100dp"
/>
<gradient
android:angle="45"
android:startColor="#5f50b6"
android:endColor="#ca1f47"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="2dp"
android:color="#b7569e"
/>
</shape>

</item>

</selector>
18 changes: 9 additions & 9 deletions app/src/main/res/layout/fragment_movie.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
android:transitionName="movieRating"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.369"
app:layout_constraintHorizontal_bias="0.472"
app:layout_constraintStart_toEndOf="@+id/showtimes"
app:layout_constraintTop_toBottomOf="@+id/movieImage"
app:layout_constraintVertical_bias="0.0"
Expand All @@ -65,12 +65,13 @@

<Button
android:id="@+id/showtimes"
android:layout_width="170dp"
android:layout_height="50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:text="@string/syningartimar"
android:textSize="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down Expand Up @@ -176,8 +177,8 @@

<Button
android:id="@+id/buttonRate"
android:layout_width="74dp"
android:layout_height="49dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
Expand Down Expand Up @@ -217,16 +218,15 @@
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:transitionName="bioRating"
android:gravity="center_vertical"
android:transitionName="bioRating"
app:layout_constraintBottom_toTopOf="@+id/movieTitle"
app:layout_constraintEnd_toStartOf="@+id/buttonBio"
app:layout_constraintHorizontal_bias="0.958"
app:layout_constraintHorizontal_bias="0.857"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonRate"
app:layout_constraintTop_toBottomOf="@+id/movieImage"
app:layout_constraintVertical_bias="0.787" />
app:layout_constraintTop_toBottomOf="@+id/imdbRating" />


</android.support.constraint.ConstraintLayout>
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/fragment_rate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:text="Staðfesta"
android:textSize="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
android:background="@drawable/button_background" />

</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>

0 comments on commit b5f93ee

Please sign in to comment.