ledaian41 / android_twitter_client

Twitter client that supports viewing a Twitter timeline and composing a new tweet.
MIT License
0 stars 0 forks source link

Thanks! #1

Open dattran2346 opened 7 years ago

dattran2346 commented 7 years ago

Good to see

Gson gson = new Gson()
Tweet tweet = gson.fromJson("some messy json", Tweet.class);

Actually the Retrofit library also use Gson to parse API Response

.addConverterFactory(GsonConverterFactory.create())
public class BindingUtil {
    @BindingAdapter("bind:image")
    public static void loadProfile(ImageView imageView, String url) {
        Picasso.with(imageView.getContext()).load(url).into(imageView);
    }
<ImageView
    app:image="@{tweet.imageUrl}"/>

Final world

ledaian41 commented 7 years ago

Thanks for your feedback !! @dattran2346 I will try databinding for ImageView, I didn't know it before. I have an issue that my app occurs some lags, and delay when scroll. I think cause of it is photo loading for ImageView. Sometime when scroll screen too fast, the app is crashed and occurs bug: OutOfMemory. I don't know to fix it. 😞

Thank you.

dattran2346 commented 7 years ago

A brute force solution is to use add these line in AndroidManifest.xml

<application
        android:largeHeap="true"
        android:hardwareAccelerated="true"

If the exception is cause by the image loading library, try to use: Glide.with(context).load(url).resize(..), that may help :)