From 1a4c980df3dde727248375d43e67d30f44ca9a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20V=C4=83n=20Ch=C6=B0=C6=A1ng?= Date: Mon, 30 Sep 2019 14:05:54 +0700 Subject: [PATCH] Add listener action on view popup --- .../executionHistory/executionHistory.bin | Bin 2696973 -> 2696973 bytes .gradle/5.4.1/fileHashes/fileHashes.bin | Bin 232819 -> 232819 bytes .gradle/5.4.1/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../5.4.1/fileHashes/resourceHashesCache.bin | Bin 22067 -> 22067 bytes .gradle/5.4.1/javaCompile/classAnalysis.bin | Bin 281651 -> 282133 bytes .gradle/5.4.1/javaCompile/jarAnalysis.bin | Bin 280911 -> 280911 bytes .idea/workspace.xml | 82 +++++++++--------- .../com/ccc/countrycodepicker/MainActivity.kt | 1 - ccp/.gitignore | 10 +++ .../com/ccc/ccp/CountryCodePickerFragment.kt | 23 ++++- 10 files changed, 71 insertions(+), 45 deletions(-) diff --git a/.gradle/5.4.1/executionHistory/executionHistory.bin b/.gradle/5.4.1/executionHistory/executionHistory.bin index dc6626f6e5ac9240e48e87c9fa4603c19901f384..3092c30c92873186e1fb77cc4c0cc34c26790044 100644 GIT binary patch delta 3261 zcmdT`eNYo;8qX#qARuhw?naW3T_9SC_(9SWD8hga6g>|KspU%xk--54!-uq-D4?uH z3J4VI(^BoP+!i?TMG3bV3uOnHK-pYp8W1o(YLlE@lEY~ColN164= zGx|WRg$X;+mpFcxfT{GL`^VIV~YfubOz_#^BUVkk&#< zQSlHl?1iUY**=~sjtNkuEYIvbJyQ$YWI`hx+(O2}(=nnR*XukYJIX#@t9$U(<3Fgs zkAQ}3k7bZQK}119BzXvbzo@9GH_tt1i6*zqGp`#PTZ4vH$=%s~UTN z`Y>1Fw^}NjKKywm*g3=QGICh9zWd@S+erF>Eg|EB^7zFXM{avjR0TQa!(-EUYhwn~ z|CMrs_@l&PbfbyvRXUx1!Ail|Mw2lR;t{z3+K-c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k{bAB z^p#SDkGaQt$=23ONv=@R)fOnoAB74yz^m$-g7>%{l5!7%uFZWYNYyNR zsLpdn9K<*kqRSTrI%pRV=nl2&d>?`YSC`z8Yxs`aW+e+a2vP;kfRu3iKQUdZ*sTi; zmc$WK!6fsi>*C(tGoAc?sU$QXV^GtMz!!rrbB4l{ zIS5~ce{f^4Zxs9?l)}N;GuX_hDO}RixB!9kg#<19Ge`pt{7{Ay?4huM^)X?v&WVXx zW)?5CSHdK}4X`Xo99Po!O7fXW0YNg@OEU-MA+OoD;Hz+fmso>C0`@L;(9(`&X(XoFXeh(T_WBghSof-MT-82Ly+7$b7G;Z5NmNoH_U z$OXJKH>m|29v^auwD7ucM9R9s1TolSQRD>1$UrB#Y5_>e`T`#*btq}VEHXp#8MDwI zB#CqAkbuy{Pq-ej5HD~f5D`rV$pFS#4LV~DkX3>m=#LGn-Y zg2eh&a1fkP7BFI@9yWJstj;e=`Zd5*%bZK#5o`)=HCYhH`j>Ah8*AyryP@LdVx z$eJnJI6qUaE&M{@PgEnj%2%$E?gZE zHj nyA?iZY~1i%netnZfTqxpY0)Ql?ES8D$Q5r4if diff --git a/.gradle/5.4.1/fileHashes/fileHashes.lock b/.gradle/5.4.1/fileHashes/fileHashes.lock index 8dbf9bb090cef7efcd03cb6a5182a960401b9148..76fe77a73f750ebe7dc6babea37c61b0f75387ff 100644 GIT binary patch literal 17 VcmZQx=wu}L^53}}1~5>c1^_f&1qc8D literal 17 VcmZQx=wu}L^53}}1~5>I0{}E51kV5f diff --git a/.gradle/5.4.1/fileHashes/resourceHashesCache.bin b/.gradle/5.4.1/fileHashes/resourceHashesCache.bin index 7a75793dc0d8dec52b2d9f9479bd7a927bbf4adb..2c79a876f220c8f7fa211c260850b43f0713f708 100644 GIT binary patch delta 226 zcmdnIhH>*6#tps_0`0&0CJL-u)6W0~p`DvuC0;NJEPe8W=SEdzCRFt7WL2r3lg*^# zC$E(@n9M8V$*-T;+9P~H3?d&UxY<`GfobzmISnR(M8gkSi%lLBL$$7+{8V9vK;HkP z=OrJXE`bWZ-(0GwWHNbgpi)TIw)1;GK8>GOWB&SYB#6=8H}dFjXnQyu5xSjCc%|4!MSr^Pv#9%0|4IFNuU4# delta 233 zcmdnIhH>*6#tps_n^PqoFiwt@`pCadr0kftmH`78gub8bDxD#4vET7zZ~k>ps9@*h zrP3A}H|kDh#_gW<6e1WV_#X;xdj?Okuw=duReW~xRq4RZb~52i0>%q7k~R13gvqSl z+$(3mH2JE+gw3^zQYMq@y_G^dm+s@;c1w%x)UHJi-@>m%0}YWg1`?7$EC|8^{ds;I owme~#CR#Cz_a5Uc!&DJoB@@p+Yi`gZ?sqb8K5Ms4<_%K=07#`xwg3PC diff --git a/.gradle/5.4.1/javaCompile/classAnalysis.bin b/.gradle/5.4.1/javaCompile/classAnalysis.bin index a61aacf81ac77fb4f44b1a4e1ce039d0ca5f39a8..ffc3bc22d7290cfe6e91e8e8820e890e1892718e 100644 GIT binary patch delta 151 zcmdlyLvZRG!3`!7jL#;UO048}NXSm~UiqB?1Xz3&H(!;oWaCfTk!x{K8e+4AvMLLKJ)0ZV%bV7{Rsu$O%RV w*6lLq7>!vOZ*EkyU}-P7&IrUz+Y7EUFU#NDc|x0UyOSUDW9H3GyFW4l0GQ1*MF0Q* delta 152 zcmbO_M{x5D!3`!7j87+{4s0vhez$}H1XygAP3DzSgj&-tH}bt0E5(@7Sr)JDJc2Cq7zJMJGRu2*_C8;j)``Dq zbq79gp0M>h<91nIW+Ue9cTHJ5SfrV%85o#~L0F)u?7OXw@TG98_y^1>V z5zvYLJn78w^UjQZ$qOQ_v%0r8@-gZ$NiASt;F$r!0{j(QYZgrWe*aYYz3I+HtZb7D nm#IwOkjUhS={!aO7NhNNWmxo?FkH5My)dI7({@`$mMQE2JV1Dl delta 297 zcmX>r*2Y*sh0WPCIqlESqt9VJMT@ z^nMQJ1p=EnS1(|=ysKW$weFdXcuUXZ1>PEh0*%|&ur_`ntBs`r_i1Fd{ zcsZ7{+jj}E)Nl&0%HH)$m2dcb - @@ -18,11 +17,10 @@ - - + - + - - + + - + - - + + @@ -118,8 +116,8 @@ - - + + @@ -198,7 +196,6 @@ @@ -423,7 +421,7 @@ - + @@ -431,13 +429,13 @@ - + - + @@ -609,20 +607,17 @@ - + - - + + - + - - - - - + + @@ -641,46 +636,49 @@ - + - - + + + - + - - + + - + - - + + + + + - - - + + - + - - + + - + - - + + diff --git a/app/src/main/java/com/ccc/countrycodepicker/MainActivity.kt b/app/src/main/java/com/ccc/countrycodepicker/MainActivity.kt index a0da114..7666faa 100644 --- a/app/src/main/java/com/ccc/countrycodepicker/MainActivity.kt +++ b/app/src/main/java/com/ccc/countrycodepicker/MainActivity.kt @@ -26,7 +26,6 @@ class MainActivity : AppCompatActivity(), OnCountryPickedListener { val fm = supportFragmentManager val newFragment = com.ccc.ccp.CountryCodePickerFragment.getInstance(country, Locale.getDefault().language) - newFragment.setOnCountryPickedListener(this) newFragment.show(fm, com.ccc.ccp.CountryCodePickerFragment.TAG) } } diff --git a/ccp/.gitignore b/ccp/.gitignore index 796b96d..4396a95 100644 --- a/ccp/.gitignore +++ b/ccp/.gitignore @@ -1 +1,11 @@ +*.iml +.gradle +/local.properties +/.idea +/release +/keystores +.DS_Store /build +/captures +.externalNativeBuild +.cxx diff --git a/ccp/src/main/java/com/ccc/ccp/CountryCodePickerFragment.kt b/ccp/src/main/java/com/ccc/ccp/CountryCodePickerFragment.kt index 9e16315..677064b 100644 --- a/ccp/src/main/java/com/ccc/ccp/CountryCodePickerFragment.kt +++ b/ccp/src/main/java/com/ccc/ccp/CountryCodePickerFragment.kt @@ -1,6 +1,6 @@ package com.ccc.ccp -import android.app.Dialog +import android.content.Context import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -18,6 +18,20 @@ class CountryCodePickerFragment : DialogFragment(), CountryCodeAdapter.OnItemCli private var mOnCountryPicked: OnCountryPickedListener? = null + override fun onAttach(context: Context) { + super.onAttach(context) + if (mOnCountryPicked == null && context is OnCountryPickedListener) { + mOnCountryPicked = context + } + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + if (mOnCountryPicked == null && parentFragment is OnCountryPickedListener) { + mOnCountryPicked = parentFragment as? OnCountryPickedListener + } + } + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? @@ -70,7 +84,12 @@ class CountryCodePickerFragment : DialogFragment(), CountryCodeAdapter.OnItemCli val manager = LinearLayoutManager(context) mView.recyclerView.layoutManager = manager mView.recyclerView.adapter = mAdapter - mAdapter.updateData(Country.loadCountryDataFromXML(context, arguments?.getString("LanguageCode")?: Locale.getDefault().language)) + mAdapter.updateData( + Country.loadCountryDataFromXML( + context, + arguments?.getString("LanguageCode") ?: Locale.getDefault().language + ) + ) mAdapter.setOnItemClickListener(this) }