Make contributors clickable (#7129)
This commit is contained in:
parent
c56facd141
commit
7b048ed579
@ -1,6 +1,6 @@
|
||||
ByteHamster;Project lead;https://avatars2.githubusercontent.com/u/5811634?s=60&v=4
|
||||
Keunes;Project lead;https://avatars2.githubusercontent.com/u/11229646?s=60&v=4
|
||||
Femmdi;Translations coordinator;https://avatars2.githubusercontent.com/u/47671383?s=60&v=4
|
||||
Ryan Gorley (Freehive);2023 brand design;https://avatars2.githubusercontent.com/u/12849958?s=60&v=4
|
||||
221 Pixels;2020 brand design;https://avatars2.githubusercontent.com/u/58243143?s=60&v=4
|
||||
Anxhelo Lushka;2020 website design;https://avatars2.githubusercontent.com/u/25004151?s=60&v=4
|
||||
ByteHamster;Project lead;https://avatars2.githubusercontent.com/u/5811634?s=60&v=4;ByteHamster
|
||||
Keunes;Project lead;https://avatars2.githubusercontent.com/u/11229646?s=60&v=4;Keunes
|
||||
Femmdi;Translations coordinator;https://avatars2.githubusercontent.com/u/47671383?s=60&v=4;Femmdi
|
||||
Ryan Gorley (Freehive);2023 brand design;https://avatars2.githubusercontent.com/u/12849958?s=60&v=4;Freehive
|
||||
221 Pixels;2020 brand design;https://avatars2.githubusercontent.com/u/58243143?s=60&v=4;221pxls
|
||||
Anxhelo Lushka;2020 website design;https://avatars2.githubusercontent.com/u/25004151?s=60&v=4;AnXh3L0
|
||||
|
|
@ -2,10 +2,13 @@ package de.danoeh.antennapod.ui.preferences.screen.about;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.ListFragment;
|
||||
|
||||
import de.danoeh.antennapod.ui.common.IntentUtils;
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleOnSubscribe;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@ -18,15 +21,15 @@ import java.util.ArrayList;
|
||||
|
||||
public class DevelopersFragment extends ListFragment {
|
||||
private Disposable developersLoader;
|
||||
private ArrayList<SimpleIconListAdapter.ListItem> developers = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
getListView().setDivider(null);
|
||||
getListView().setSelector(android.R.color.transparent);
|
||||
|
||||
developersLoader = Single.create((SingleOnSubscribe<ArrayList<SimpleIconListAdapter.ListItem>>) emitter -> {
|
||||
ArrayList<SimpleIconListAdapter.ListItem> developers = new ArrayList<>();
|
||||
developers.clear();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||
getContext().getAssets().open("developers.csv"), "UTF-8"));
|
||||
String line;
|
||||
@ -43,7 +46,12 @@ public class DevelopersFragment extends ListFragment {
|
||||
developers -> setListAdapter(new SimpleIconListAdapter<>(getContext(), developers)),
|
||||
error -> Toast.makeText(getContext(), error.getMessage(), Toast.LENGTH_LONG).show()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListItemClick(@NonNull ListView l, @NonNull View v, int position, long id) {
|
||||
super.onListItemClick(l, v, position, id);
|
||||
IntentUtils.openInBrowser(getContext(), "https://github.com/" + developers.get(position).title);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,9 +6,13 @@ import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.resource.bitmap.FitCenter;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
||||
import de.danoeh.antennapod.ui.preferences.R;
|
||||
|
||||
import java.util.List;
|
||||
@ -35,13 +39,19 @@ public class SimpleIconListAdapter<T extends SimpleIconListAdapter.ListItem> ext
|
||||
ListItem item = listItems.get(position);
|
||||
((TextView) view.findViewById(R.id.title)).setText(item.title);
|
||||
((TextView) view.findViewById(R.id.subtitle)).setText(item.subtitle);
|
||||
Glide.with(context)
|
||||
.load(item.imageUrl)
|
||||
.apply(new RequestOptions()
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.fitCenter()
|
||||
.dontAnimate())
|
||||
.into(((ImageView) view.findViewById(R.id.icon)));
|
||||
|
||||
if (item.imageUrl == null) {
|
||||
view.findViewById(R.id.icon).setVisibility(View.GONE);
|
||||
} else {
|
||||
Glide.with(context)
|
||||
.load(item.imageUrl)
|
||||
.apply(new RequestOptions()
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.transform(new FitCenter(), new RoundedCorners((int)
|
||||
(4 * context.getResources().getDisplayMetrics().density)))
|
||||
.dontAnimate())
|
||||
.into(((ImageView) view.findViewById(R.id.icon)));
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -2,10 +2,13 @@ package de.danoeh.antennapod.ui.preferences.screen.about;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.ListFragment;
|
||||
|
||||
import de.danoeh.antennapod.ui.common.IntentUtils;
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleOnSubscribe;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@ -19,22 +22,23 @@ import java.util.ArrayList;
|
||||
public class SpecialThanksFragment extends ListFragment {
|
||||
private Disposable translatorsLoader;
|
||||
|
||||
private ArrayList<SpecialMemberItem> specialMembers = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
getListView().setDivider(null);
|
||||
getListView().setSelector(android.R.color.transparent);
|
||||
|
||||
translatorsLoader = Single.create((SingleOnSubscribe<ArrayList<SimpleIconListAdapter.ListItem>>) emitter -> {
|
||||
ArrayList<SimpleIconListAdapter.ListItem> translators = new ArrayList<>();
|
||||
translatorsLoader = Single.create((SingleOnSubscribe<ArrayList<SpecialMemberItem>>) emitter -> {
|
||||
specialMembers.clear();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||
getContext().getAssets().open("special_thanks.csv"), "UTF-8"));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String[] info = line.split(";");
|
||||
translators.add(new SimpleIconListAdapter.ListItem(info[0], info[1], info[2]));
|
||||
specialMembers.add(new SpecialMemberItem(info[0], info[1], info[2], info[3]));
|
||||
}
|
||||
emitter.onSuccess(translators);
|
||||
emitter.onSuccess(specialMembers);
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@ -42,7 +46,22 @@ public class SpecialThanksFragment extends ListFragment {
|
||||
translators -> setListAdapter(new SimpleIconListAdapter<>(getContext(), translators)),
|
||||
error -> Toast.makeText(getContext(), error.getMessage(), Toast.LENGTH_LONG).show()
|
||||
);
|
||||
}
|
||||
|
||||
private static class SpecialMemberItem extends SimpleIconListAdapter.ListItem {
|
||||
final String githubUsername;
|
||||
|
||||
SpecialMemberItem(String title, String subtitle, String imageUrl, String gitHubUsername) {
|
||||
super(title, subtitle, imageUrl);
|
||||
this.githubUsername = gitHubUsername;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListItemClick(@NonNull ListView l, @NonNull View v, int position, long id) {
|
||||
super.onListItemClick(l, v, position, id);
|
||||
|
||||
IntentUtils.openInBrowser(getContext(), "https://github.com/" + specialMembers.get(position).githubUsername);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user