Skip to content

Commit

Permalink
Fix buttons on fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Dec 13, 2023
1 parent afddc48 commit fdcb6db
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package de.felixnuesse.timedsilence.fragments
import android.content.Context
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand All @@ -15,18 +14,12 @@ import de.felixnuesse.timedsilence.model.database.DatabaseHandler
import de.felixnuesse.timedsilence.ui.CalendarListAdapter
import de.felixnuesse.timedsilence.ui.custom.NestedRecyclerManager
import de.felixnuesse.timedsilence.volumestate.calendar.DeviceCalendar
import kotlin.collections.ArrayList


class CalendarFragment : Fragment() {

companion object {
private const val TAG = "CalendarFragment"
var nameOfEvent = ArrayList<String>()
var startDates = ArrayList<String>()
var endDates = ArrayList<String>()
var descriptions = ArrayList<String>()

}

private lateinit var viewAdapter: RecyclerView.Adapter<*>
Expand Down Expand Up @@ -54,6 +47,9 @@ class CalendarFragment : Fragment() {
binding.buttonCalendarFragment.setOnClickListener {
CalendarDialog(view.context, this, calHandler).show()
}
binding.buttonIcon.setOnClickListener {
CalendarDialog(view.context, this, calHandler).show()
}

val db = DatabaseHandler(view.context)
viewManager = NestedRecyclerManager(view.context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package de.felixnuesse.timedsilence.fragments
import android.content.Context
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import de.felixnuesse.timedsilence.Constants
import androidx.recyclerview.widget.RecyclerView
import de.felixnuesse.timedsilence.databinding.FragmentCalendarKeywordBinding
import de.felixnuesse.timedsilence.dialogs.KeywordDialog
Expand All @@ -33,7 +31,7 @@ class KeywordFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
): View {
_binding = FragmentCalendarKeywordBinding.inflate(inflater, container, false)
return binding.root
}
Expand All @@ -43,6 +41,9 @@ class KeywordFragment : Fragment() {
binding.buttonCalendarFragment.setOnClickListener {
KeywordDialog(view.context, this).show()
}
binding.buttonIcon.setOnClickListener {
KeywordDialog(view.context, this).show()
}

val db = DatabaseHandler(view.context)
viewManager = NestedRecyclerManager(view.context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package de.felixnuesse.timedsilence.fragments

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -32,7 +31,7 @@ class TimeFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
): View {
_binding = FragmentTimeBinding.inflate(inflater, container, false)
return binding.root
}
Expand All @@ -41,6 +40,9 @@ class TimeFragment : Fragment() {
binding.buttonTimeFragment.setOnClickListener {
ScheduleDialog(view.context, this).show()
}
binding.buttonIcon.setOnClickListener {
ScheduleDialog(view.context, this).show()
}

val db = DatabaseHandler(view.context)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import de.felixnuesse.timedsilence.Constants
import de.felixnuesse.timedsilence.databinding.FragmentWifiConnectedBinding
import de.felixnuesse.timedsilence.dialogs.WifiDialog
import de.felixnuesse.timedsilence.handler.calculator.WifiHandler
Expand All @@ -35,7 +34,7 @@ class WifiConnectedFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
): View {
_binding = FragmentWifiConnectedBinding.inflate(inflater, container, false)
return binding.root
}
Expand All @@ -54,7 +53,9 @@ class WifiConnectedFragment : Fragment() {

binding.buttonWifiAddFragment.setOnClickListener {
WifiDialog(view.context, this).show()

}
binding.buttonIcon.setOnClickListener {
WifiDialog(view.context, this).show()
}


Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_calendar_event.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@
android:orientation="horizontal">

<ImageButton
android:id="@+id/buttonIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:src="@drawable/icon_add_circle"
app:tint="?attr/colorOnSecondaryContainer" />

<TextView
android:id="@+id/textView"
android:id="@+id/buttonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="4dp"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_calendar_keyword.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@
android:orientation="horizontal">

<ImageButton
android:id="@+id/buttonIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:src="@drawable/icon_add_circle"
app:tint="?attr/colorOnSecondaryContainer" />

<TextView
android:id="@+id/textView"
android:id="@+id/buttonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="4dp"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_time.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@
android:orientation="horizontal">

<ImageButton
android:id="@+id/buttonIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:src="@drawable/icon_add_circle"
app:tint="?attr/colorOnSecondaryContainer" />

<TextView
android:id="@+id/textView"
android:id="@+id/buttonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="4dp"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_wifi_connected.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@
android:orientation="horizontal">

<ImageButton
android:id="@+id/buttonIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:src="@drawable/icon_add_circle"
app:tint="?attr/colorOnSecondaryContainer" />

<TextView
android:id="@+id/textView"
android:id="@+id/buttonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="4dp"
Expand Down

0 comments on commit fdcb6db

Please sign in to comment.