Convert util/{HttpHeaderLink,PairedList,TimestampUtils,ThemeUtils} to Kotlin (#3046)
* Fix off-by-one error in HttpHeaderLink Link headers with multiple URLs with multiple parameters were being parsed incorrectly. Detected by adding unit tests ahead of converting to Kotlin. * Convert util/HttpHeaderLink from Java to Kotlin * Convert util/ThemeUtils from Java to Kotlin * Convert util/TimestampUtils from Java to Kotlin * Add tests for PairedList * Convert util/PairedList from Java to Kotlin * Implement feedback from PR * Relicense as GPL
This commit is contained in:
parent
0def7e7230
commit
22834431ca
30 changed files with 624 additions and 510 deletions
|
|
@ -21,6 +21,7 @@ import android.content.SharedPreferences;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
|
|
@ -35,6 +36,7 @@ import androidx.core.app.ActivityCompat;
|
|||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.keylesspalace.tusky.adapter.AccountSelectionAdapter;
|
||||
import com.keylesspalace.tusky.components.login.LoginActivity;
|
||||
|
|
@ -77,7 +79,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
|
|||
/* set the taskdescription programmatically, the theme would turn it blue */
|
||||
String appName = getString(R.string.app_name);
|
||||
Bitmap appIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
|
||||
int recentsBackgroundColor = ThemeUtils.getColor(this, R.attr.colorSurface);
|
||||
int recentsBackgroundColor = MaterialColors.getColor(this, R.attr.colorSurface, Color.BLACK);
|
||||
|
||||
setTaskDescription(new ActivityManager.TaskDescription(appName, appIcon, recentsBackgroundColor));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue