-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subletter xml updates (tablayout w/i subletter not working)
- Loading branch information
Showing
11 changed files
with
182 additions
and
6 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
PennMobile/src/main/java/com/pennapps/labs/pennmobile/SubletterDraftListingsFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.pennapps.labs.pennmobile | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
|
||
class SubletterDraftListingsFragment : Fragment() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle?): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_subletter_draft_listings, container, false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
PennMobile/src/main/java/com/pennapps/labs/pennmobile/SubletterHolderFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.pennapps.labs.pennmobile | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.coordinatorlayout.widget.CoordinatorLayout | ||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.widget.ViewPager2 | ||
import com.google.android.material.tabs.TabLayout | ||
import com.google.android.material.tabs.TabLayoutMediator | ||
import com.pennapps.labs.pennmobile.adapters.SubletterPagerAdapter | ||
import com.pennapps.labs.pennmobile.adapters.SublettingPagerAdapter | ||
import com.pennapps.labs.pennmobile.components.collapsingtoolbar.ToolbarBehavior | ||
import kotlinx.android.synthetic.main.fragment_dining_holder.view.appbar_home_holder | ||
|
||
class SubletterHolderFragment : Fragment() { | ||
lateinit var subletterPagerAdapter: SubletterPagerAdapter | ||
private lateinit var mActivity: MainActivity | ||
private lateinit var viewPager: ViewPager2 | ||
|
||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
mActivity = activity as MainActivity | ||
mActivity.closeKeyboard() | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle?): View? { | ||
return inflater.inflate(R.layout.fragment_subletting, container, false) | ||
} | ||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
subletterPagerAdapter = SubletterPagerAdapter(this) | ||
viewPager = view.findViewById(R.id.viewPager2) | ||
viewPager.adapter = subletterPagerAdapter | ||
val tabLayout : TabLayout = view.findViewById(R.id.subletting_tab_layout) | ||
TabLayoutMediator(tabLayout, viewPager) { tab, position -> | ||
tab.text = "OBJECT ${(position + 1)}" | ||
}.attach() | ||
|
||
} | ||
|
||
|
||
private fun initAppBar(view: View) { | ||
(view.appbar_home_holder.layoutParams as CoordinatorLayout.LayoutParams).behavior = ToolbarBehavior() | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
PennMobile/src/main/java/com/pennapps/labs/pennmobile/SubletterPostedListingsFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.pennapps.labs.pennmobile | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
|
||
class SubletterPostedListingsFragment : Fragment() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle?): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_subletter_posted_listings, container, false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/SubletterPagerAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.pennapps.labs.pennmobile.adapters | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
import com.pennapps.labs.pennmobile.SubletterDraftListingsFragment | ||
import com.pennapps.labs.pennmobile.SubletterPostedListingsFragment | ||
|
||
class SubletterPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) { | ||
override fun getItemCount(): Int = 2 | ||
override fun createFragment(position: Int): Fragment { | ||
return if (position == 0) { | ||
SubletterPostedListingsFragment() | ||
} else { | ||
SubletterDraftListingsFragment() | ||
} | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
PennMobile/src/main/res/layout/fragment_subletter_draft_listings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout 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"> | ||
|
||
<TextView | ||
android:id="@+id/textView4" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="drafts" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
16 changes: 16 additions & 0 deletions
16
PennMobile/src/main/res/layout/fragment_subletter_posted_listings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout 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"> | ||
|
||
<TextView | ||
android:id="@+id/textView5" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="posted" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters