class ShocialShareUtil private val sourceActivity AppCompatActivity pr

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class ShocialShareUtil(
private val sourceActivity: AppCompatActivity,
private val sourceFragment: Fragment?) {
fun shareHoroscope(sharedHoroscopeContent: SharedHoroscopeContent, destenation: SharedDestenation) {
if (sourceFragment != null) {
when (destenation) {
SharedDestenation.VK -> { /* share VK with fragment processing */ }
SharedDestenation.FACEBOOK -> { /* share Facebook with fragment processing */ }
}
} else {
when (destenation) {
SharedDestenation.VK -> { /* share VK with activity processing */ }
SharedDestenation.FACEBOOK -> { /* share Facebook with activity processing */ }
}
}
}
enum class SharedDestenation {
VK, FACEBOOK
}
}