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 evepraisal | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |
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
model.loading().observe(this, Observer { | |
when (it) { | |
true -> binding.contentLoading.show() | |
false -> binding.contentLoading.hide() | |
} | |
}) |
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
abstract class LoaderModel: ViewModel() { | |
private var loadingCount: AtomicInteger = AtomicInteger(0) | |
private val isLoading: MutableLiveData<Boolean> = MutableLiveData() | |
init { | |
isLoading.value = false | |
} |
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
private val valueHandler = object: ValueEventListener { | |
override fun onDataChange(snapshot: DataSnapshot?) { | |
groups.value = snapshot?.children?.distinct() ?: emptyList() | |
loadFinished() | |
} | |
override fun onCancelled(error: DatabaseError?) { | |
groups.value = emptyList() | |
loadFinished() | |
} |
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
public class MainActivity extends ActionBarActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
} |
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
private ActionBarDrawerToggle mDrawerToggle; | |
private DrawerLayout mDrawerLayout; | |
private ListView mDrawerList; | |
private View mHeaderView; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
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
@Override | |
public ViewHolder onCreateViewHolder(ViewGroup parent) { | |
final ImageCardView cardView = new ImageCardView(mContext); | |
cardView.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
@Override | |
public void onFocusChange(View view, final boolean isFocused) { | |
final View infoField = view.findViewById(R.id.info_field); | |
final TextView contentField = (TextView)view.findViewById(R.id.content_text); | |
final TextView titleField = (TextView)view.findViewById(R.id.title_text); |