11package com .tungsten .fcl .ui .download ;
22
33import android .content .Context ;
4- import android .graphics .Bitmap ;
5- import android .graphics .BitmapFactory ;
64import android .view .LayoutInflater ;
75import android .view .View ;
86import android .view .ViewGroup ;
97
108import com .bumptech .glide .Glide ;
119import com .mio .util .AnimUtil ;
1210import com .tungsten .fcl .R ;
13- import com .tungsten .fcl .setting .Profiles ;
1411import com .tungsten .fcl .util .ModTranslations ;
1512import com .tungsten .fclcore .mod .LocalModFile ;
1613import com .tungsten .fclcore .mod .ModManager ;
2017import com .tungsten .fclcore .util .StringUtils ;
2118import com .tungsten .fcllibrary .component .FCLAdapter ;
2219import com .tungsten .fcllibrary .component .theme .ThemeEngine ;
23- import com .tungsten .fcllibrary .util .LocaleUtils ;
2420import com .tungsten .fcllibrary .component .view .FCLImageView ;
2521import com .tungsten .fcllibrary .component .view .FCLLinearLayout ;
2622import com .tungsten .fcllibrary .component .view .FCLTextView ;
23+ import com .tungsten .fcllibrary .util .LocaleUtils ;
2724
28- import java .io .IOException ;
29- import java .io .InputStream ;
30- import java .net .HttpURLConnection ;
31- import java .net .URL ;
3225import java .util .ArrayList ;
3326import java .util .List ;
3427import java .util .Optional ;
@@ -103,6 +96,9 @@ public View getView(int i, View view, ViewGroup viewGroup) {
10396 return remoteName .contains (localName );
10497 }).collect (Collectors .toList ());
10598 for (LocalModFile localModFile : modFiles ) {
99+ if (localModFile .getRemoteVersion () != null && !remoteMod .getModID ().equals (localModFile .getRemoteVersion ().getModid ())) {
100+ localModFile .setRemoteVersion (null );
101+ }
106102 if (localModFile .getRemoteVersion () == null ) {
107103 Optional <RemoteMod .Version > remoteVersionOptional = downloadPage .getRepository ().getRemoteVersionByLocalFile (localModFile , localModFile .getFile ());
108104 remoteVersionOptional .ifPresent (localModFile ::setRemoteVersion );
@@ -118,7 +114,10 @@ public View getView(int i, View view, ViewGroup viewGroup) {
118114 return null ;
119115 }).whenComplete (Schedulers .androidUIThread (), (result , exception ) -> {
120116 if (exception == null && result != null ) {
121- viewHolder .name .setText (String .format ("[%s] %s" , getContext ().getString (R .string .installed ), viewHolder .name .getText ()));
117+ String text = viewHolder .name .getText ().toString ();
118+ if (!text .startsWith (getContext ().getString (R .string .installed ))) {
119+ viewHolder .name .setText (String .format ("[%s] %s" , getContext ().getString (R .string .installed ), text ));
120+ }
122121 }
123122 }).start ();
124123 }
0 commit comments