This file contains hidden or 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
package com.tapura.podmorecasts.download; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.support.annotation.Nullable; | |
import com.google.gson.Gson; | |
import java.util.ArrayList; |
This file contains hidden or 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
package com.tapura.podmorecasts | |
import android.support.test.espresso.Espresso.onView | |
import android.support.test.espresso.action.ViewActions.pressImeActionButton | |
import android.support.test.espresso.matcher.ViewMatchers.withId | |
class ActRobot { | |
fun clickOkInSearchBar() { | |
onView(withId(android.support.design.R.id.search_src_text)).perform().perform(pressImeActionButton()) | |
} |
This file contains hidden or 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() { | |
private var myTextView: TextView? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
myTextView = findViewById(R.id.txtView) | |
This file contains hidden or 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
import kotlinx.android.synthetic.main.activity_main.* | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
// Já podemos utilizar o txtView | |
// sem necessidade de criar um membro p/ classe |
This file contains hidden or 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
import kotlinx.android.synthetic.main.list_item_example.view.* | |
class MyAdapter : ListAdapter<String, MyAdapter.MyViewHolder>(DiffCallBack()) { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder { | |
val view = | |
LayoutInflater.from(parent.context) | |
.inflate(R.layout.list_item_example, parent, false) | |
return MyViewHolder(view) |