-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mod] #8 BindingActivity, BindingFragment 적용
- Loading branch information
1 parent
3c818f0
commit f4a3fab
Showing
5 changed files
with
10 additions
and
124 deletions.
There are no files selected for viewing
20 changes: 2 additions & 18 deletions
20
app/src/main/java/org/sopt/kream/presentation/ui/main/MainActivity.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 |
---|---|---|
@@ -1,22 +1,6 @@ | ||
package org.sopt.kream.presentation.ui.main | ||
|
||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
import org.sopt.kream.databinding.ActivityMainBinding | ||
import org.sopt.kream.util.base.BindingActivity | ||
|
||
class MainActivity : AppCompatActivity() { | ||
private var _binding: ActivityMainBinding? = null | ||
private val binding: ActivityMainBinding | ||
get() = requireNotNull(_binding) | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
_binding = ActivityMainBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
_binding = null | ||
} | ||
} | ||
class MainActivity : BindingActivity<ActivityMainBinding>({ ActivityMainBinding.inflate(it) }) |
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
33 changes: 2 additions & 31 deletions
33
app/src/main/java/org/sopt/kream/presentation/ui/productdetail/ProductDetailFragment.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 |
---|---|---|
@@ -1,35 +1,6 @@ | ||
package org.sopt.kream.presentation.ui.productdetail | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import org.sopt.kream.databinding.FragmentProductDetailBinding | ||
import org.sopt.kream.util.base.BindingFragment | ||
|
||
class ProductDetailFragment : Fragment() { | ||
private var _binding: FragmentProductDetailBinding? = null | ||
private val binding: FragmentProductDetailBinding | ||
get() = requireNotNull(_binding) { } | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle?, | ||
): View? { | ||
_binding = FragmentProductDetailBinding.inflate(inflater, container, false) | ||
return binding.root | ||
} | ||
|
||
override fun onViewCreated( | ||
view: View, | ||
savedInstanceState: Bundle?, | ||
) { | ||
super.onViewCreated(view, savedInstanceState) | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
_binding = null | ||
} | ||
} | ||
class ProductDetailFragment : BindingFragment<FragmentProductDetailBinding>({ FragmentProductDetailBinding.inflate(it) }) |
33 changes: 2 additions & 31 deletions
33
app/src/main/java/org/sopt/kream/presentation/ui/search/SearchFragment.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 |
---|---|---|
@@ -1,35 +1,6 @@ | ||
package org.sopt.kream.presentation.ui.search | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import org.sopt.kream.databinding.FragmentSearchBinding | ||
import org.sopt.kream.util.base.BindingFragment | ||
|
||
class SearchFragment : Fragment() { | ||
private var _binding: FragmentSearchBinding? = null | ||
private val binding: FragmentSearchBinding | ||
get() = requireNotNull(_binding) { } | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle?, | ||
): View? { | ||
_binding = FragmentSearchBinding.inflate(inflater, container, false) | ||
return binding.root | ||
} | ||
|
||
override fun onViewCreated( | ||
view: View, | ||
savedInstanceState: Bundle?, | ||
) { | ||
super.onViewCreated(view, savedInstanceState) | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
_binding = null | ||
} | ||
} | ||
class SearchFragment : BindingFragment<FragmentSearchBinding>({ FragmentSearchBinding.inflate(it) }) |