-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[REFACTOR] 이미지 라이선스 추가
- Loading branch information
Showing
8 changed files
with
226 additions
and
1 deletion.
There are no files selected for viewing
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
36 changes: 36 additions & 0 deletions
36
app/src/main/java/com/ivyclub/contact/ui/main/settings/license/LicenseFragment.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,36 @@ | ||
package com.ivyclub.contact.ui.main.settings.license | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.navigation.fragment.findNavController | ||
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity | ||
import com.ivyclub.contact.R | ||
import com.ivyclub.contact.databinding.FragmentLicenseBinding | ||
import com.ivyclub.contact.util.BaseFragment | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class LicenseFragment : BaseFragment<FragmentLicenseBinding>(R.layout.fragment_license) { | ||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
initBackIcon() | ||
initSettingButton() | ||
} | ||
|
||
private fun initBackIcon() { | ||
binding.ivBackIcon.setOnClickListener { | ||
val navController = findNavController() | ||
navController.popBackStack() | ||
} | ||
} | ||
|
||
private fun initSettingButton() { | ||
binding.tvImageLicense.setOnClickListener { | ||
findNavController().navigate(R.id.action_licenseFragment_to_imageLicenseFragment) | ||
} | ||
binding.tvOssLicense.setOnClickListener { | ||
startActivity(Intent(requireActivity(), OssLicensesMenuActivity::class.java)) | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...n/java/com/ivyclub/contact/ui/main/settings/license/image_license/ImageLicenseFragment.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,26 @@ | ||
package com.ivyclub.contact.ui.main.settings.license.image_license | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.navigation.fragment.findNavController | ||
import com.ivyclub.contact.R | ||
import com.ivyclub.contact.databinding.FragmentImageLicenseBinding | ||
import com.ivyclub.contact.util.BaseFragment | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class ImageLicenseFragment : | ||
BaseFragment<FragmentImageLicenseBinding>(R.layout.fragment_image_license) { | ||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
initBackIcon() | ||
} | ||
|
||
private fun initBackIcon() { | ||
binding.ivBackIcon.setOnClickListener { | ||
val navController = findNavController() | ||
navController.popBackStack() | ||
} | ||
} | ||
|
||
} |
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,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
android:tint="@color/black"> | ||
<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,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<data> | ||
|
||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<ImageView | ||
android:id="@+id/iv_back_icon" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="8dp" | ||
android:background="?attr/selectableItemBackground" | ||
android:contentDescription="@string/fragment_settings_go_back" | ||
android:padding="4dp" | ||
android:src="@drawable/ic_baseline_arrow_back_24" | ||
app:layout_constraintBottom_toBottomOf="@id/tv_settings" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="@id/tv_settings" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_settings" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="16dp" | ||
android:text="@string/image_license" | ||
android:textColor="@color/black" | ||
android:textSize="20sp" | ||
android:textStyle="bold" | ||
app:layout_constraintStart_toEndOf="@id/iv_back_icon" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="16dp" | ||
android:layout_marginTop="16dp" | ||
android:text="@string/image_license_detail" | ||
android:textColor="@color/black" | ||
android:textSize="16sp" | ||
app:layout_constraintTop_toBottomOf="@id/tv_settings" /> | ||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
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,69 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<data> | ||
|
||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<ImageView | ||
android:id="@+id/iv_back_icon" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="8dp" | ||
android:background="?attr/selectableItemBackground" | ||
android:contentDescription="@string/fragment_settings_go_back" | ||
android:padding="4dp" | ||
android:src="@drawable/ic_baseline_arrow_back_24" | ||
app:layout_constraintBottom_toBottomOf="@id/tv_settings" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="@id/tv_settings" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_settings" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="16dp" | ||
android:text="@string/open_source_license" | ||
android:textColor="@color/black" | ||
android:textSize="20sp" | ||
android:textStyle="bold" | ||
app:layout_constraintStart_toEndOf="@id/iv_back_icon" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_image_license" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:background="?attr/selectableItemBackground" | ||
android:drawablePadding="20dp" | ||
android:padding="12dp" | ||
android:text="@string/image_license" | ||
android:textColor="@color/black" | ||
android:textSize="20sp" | ||
app:drawableStartCompat="@drawable/ic_baseline_image_24" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/iv_back_icon" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_oss_license" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:background="?attr/selectableItemBackground" | ||
android:drawablePadding="20dp" | ||
android:padding="12dp" | ||
android:text="@string/open_source_license" | ||
android:textColor="@color/black" | ||
android:textSize="20sp" | ||
app:drawableStartCompat="@drawable/ic_baseline_library_books_24" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/tv_image_license" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
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