-
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.
Merge remote-tracking branch 'origin/subletting' into subletting
# Conflicts: # PennMobile/src/main/res/layout/fragment_subletting.xml
- Loading branch information
Showing
19 changed files
with
983 additions
and
9 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
PennMobile/src/main/java/com/pennapps/labs/pennmobile/NewListingsFragment.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,20 @@ | ||
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 NewListingsFragment : 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_new_listings, container, false) | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
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,45 @@ | ||
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 | ||
|
||
|
||
} | ||
|
||
|
||
private fun initAppBar(view: View) { | ||
(view.appbar_home_holder.layoutParams as CoordinatorLayout.LayoutParams).behavior = ToolbarBehavior() | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
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,40 @@ | ||
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 | ||
import androidx.fragment.app.FragmentTransaction | ||
import com.pennapps.labs.pennmobile.databinding.FragmentSubletterPostedListingsBinding | ||
|
||
class SubletterPostedListingsFragment : Fragment() { | ||
private var _binding: FragmentSubletterPostedListingsBinding? = null | ||
private val binding get() = _binding!! | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle?): View? { | ||
// Inflate the layout for this fragment | ||
_binding = FragmentSubletterPostedListingsBinding.inflate(inflater, container, false) | ||
binding.postedAddListingButton.setOnClickListener{ | ||
navigateCreateNewListing() | ||
} | ||
return binding.root | ||
} | ||
|
||
|
||
private fun navigateCreateNewListing() { | ||
val mainActivity = activity as MainActivity | ||
val fragment = NewListingsFragment() | ||
|
||
val fragmentManager = mainActivity.supportFragmentManager | ||
fragmentManager.beginTransaction() | ||
.replace(R.id.content_frame, fragment, "NEW_LISTING_FRAGMENT") | ||
.addToBackStack(null) | ||
.commitAllowingStateLoss() | ||
|
||
} | ||
} |
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() | ||
} | ||
} | ||
|
||
} |
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,5 @@ | ||
<vector android:height="24dp" android:tint="#8A8A8D" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M19,7v2.99s-1.99,0.01 -2,0L17,7h-3s0.01,-1.99 0,-2h3L17,2h2v3h3v2h-3zM16,11L16,8h-3L13,5L5,5c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2v-8h-3zM5,19l3,-4 2,3 3,-4 4,5L5,19z"/> | ||
</vector> |
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,5 @@ | ||
<vector android:height="24dp" android:tint="#8A8A8D" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M19,4h-1V2h-2v2H8V2H6v2H5C3.89,4 3.01,4.9 3.01,6L3,20c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2V6C21,4.9 20.1,4 19,4zM19,20H5V10h14V20zM9,14H7v-2h2V14zM13,14h-2v-2h2V14zM17,14h-2v-2h2V14zM9,18H7v-2h2V18zM13,18h-2v-2h2V18zM17,18h-2v-2h2V18z"/> | ||
</vector> |
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,5 @@ | ||
<vector android:height="24dp" android:tint="#8A8A8D" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z"/> | ||
</vector> |
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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<stroke android:width="1dp" android:color="#8A8A8D" /> | ||
<corners android:radius="6dp"/> | ||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /> | ||
</shape> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<vector | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="332dp" | ||
android:height="150dp" | ||
android:viewportWidth="97.1" | ||
android:viewportHeight="59.1" | ||
> | ||
|
||
<group> | ||
|
||
<clip-path | ||
android:pathData="M8.33974 0.05H88.7603C93.3386 0.05 97.05 3.76144 97.05 8.33974V50.7603C97.05 55.3386 93.3386 59.05 88.7603 59.05H8.33974C3.76144 59.05 0.05 55.3386 0.05 50.7603V8.33974C0.05 3.76144 3.76144 0.05 8.33974 0.05Z" | ||
/> | ||
|
||
<path | ||
android:pathData="M0.05 0.05V59.05H97.05V0.05" | ||
android:fillColor="#F6F7F8" | ||
/> | ||
|
||
</group> | ||
|
||
<path | ||
android:pathData="M8.33974 0.05H88.7603C93.3386 0.05 97.05 3.76144 97.05 8.33974V50.7603C97.05 55.3386 93.3386 59.05 88.7603 59.05H8.33974C3.76144 59.05 0.05 55.3386 0.05 50.7603V8.33974C0.05 3.76144 3.76144 0.05 8.33974 0.05Z" | ||
android:strokeWidth="0.1" | ||
android:strokeColor="#CACACA" | ||
/> | ||
|
||
</vector> |
Oops, something went wrong.