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
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
progressbar.visibility = View.VISIBLE | |
rv_photos.layoutManager = LinearLayoutManager(this) | |
rv_photos.adapter = PhotosAdapter(ArrayList()) |
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
override fun setMenuVisibility(menuVisible: Boolean) { | |
super.setMenuVisibility(menuVisible) | |
if (menuVisible){ | |
// This routes the system back button to this Fragment | |
requireFragmentManager().beginTransaction() | |
.setPrimaryNavigationFragment(this) | |
.commit() | |
} | |
} |
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
fun nonInlined(block: () -> Unit) { | |
println("before") | |
block() | |
println("after") | |
} |
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
public void nonInlined(Function block) { | |
System.out.println("before"); | |
block.invoke(); | |
System.out.println("after"); | |
} |
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
nonInlined { | |
println("do something here") | |
} |
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
nonInlined(new Function() { | |
@Override | |
public void invoke() { | |
System.out.println("do something here"); | |
} | |
}); |
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
inline fun inlined(block: () -> Unit) { | |
println("before") | |
block() | |
println("after") | |
} |
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
inlined { | |
println("do something here") | |
} |
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
System.out.println("before"); | |
System.out.println("do something here"); | |
System.out.println("after"); |
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
public void doSomething() { | |
System.out.print("doSomething start"); | |
System.out.print("doSomethingElse"); | |
} |