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 fun getPieChartColors( | |
numPieSlices: Int, adjacentColors: Boolean | |
): IntArray { | |
val colors = IntArray(numPieSlices) | |
val baseColor = Color.parseColor("#8A56E2") | |
colors[0] = baseColor | |
val hsv = FloatArray(3) | |
Color.RGBToHSV( | |
Color.red(baseColor), Color.green(baseColor), Color.blue(baseColor), | |
hsv |
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 test; | |
import android.arch.lifecycle.LiveData; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; |
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
RelativeLayout layout = (RelativeLayout) findViewById(R.id.rel); | |
GradientDrawable drawable = new GradientDrawable(); | |
drawable.setColors(new int[] { | |
Color.parseColor("#FFF6B7"), | |
Color.parseColor("#F6416C") | |
}); | |
drawable.setGradientType(GradientDrawable.LINEAR_GRADIENT); | |
drawable.setOrientation(GradientDrawable.Orientation.LEFT_RIGHT); |