mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-05-07 01:04:27 +02:00
indent code
This commit is contained in:
parent
9d49498756
commit
78c62670d5
@ -13,19 +13,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.reandroid.arsc.value;
|
||||
package com.reandroid.arsc.value;
|
||||
|
||||
import com.reandroid.arsc.base.Block;
|
||||
import com.reandroid.arsc.container.FixedBlockContainer;
|
||||
import com.reandroid.arsc.io.BlockLoad;
|
||||
import com.reandroid.arsc.io.BlockReader;
|
||||
import com.reandroid.arsc.item.ByteArray;
|
||||
import com.reandroid.arsc.item.IntegerItem;
|
||||
import com.reandroid.json.JSONConvert;
|
||||
import com.reandroid.json.JSONObject;
|
||||
import com.reandroid.arsc.base.Block;
|
||||
import com.reandroid.arsc.container.FixedBlockContainer;
|
||||
import com.reandroid.arsc.io.BlockLoad;
|
||||
import com.reandroid.arsc.io.BlockReader;
|
||||
import com.reandroid.arsc.item.ByteArray;
|
||||
import com.reandroid.arsc.item.IntegerItem;
|
||||
import com.reandroid.json.JSONConvert;
|
||||
import com.reandroid.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ResConfig extends FixedBlockContainer
|
||||
implements BlockLoad, JSONConvert<JSONObject>, Comparable<ResConfig> {
|
||||
@ -206,7 +206,6 @@ import java.util.Arrays;
|
||||
}
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
public void setOrientation(byte b){
|
||||
if(getConfigSize()<SIZE_16){
|
||||
if(b==0){
|
||||
@ -428,6 +427,33 @@ import java.util.Arrays;
|
||||
}
|
||||
return mValuesContainer.getShortUnsigned(OFFSET_minorVersion);
|
||||
}
|
||||
public void setUiMode(int mode){
|
||||
if(getConfigSize()<SIZE_32){
|
||||
if(mode==0){
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Can not set uiMode for config size="+getConfigSize());
|
||||
}
|
||||
mValuesContainer.put(OFFSET_uiMode, (byte) mode);
|
||||
}
|
||||
public int getUiMode(){
|
||||
if(getConfigSize()<SIZE_32){
|
||||
return 0;
|
||||
}
|
||||
return mValuesContainer.getByteUnsigned(OFFSET_uiMode);
|
||||
}
|
||||
public UiModeType getUiModeType(){
|
||||
return UiModeType.valueOf(getUiMode());
|
||||
}
|
||||
public void setUiModeType(UiModeType uiModeType){
|
||||
setUiMode(UiModeType.update(uiModeType, getUiMode()));
|
||||
}
|
||||
public UiModeNight getUiModeNight(){
|
||||
return UiModeNight.valueOf(getUiMode());
|
||||
}
|
||||
public void setUiModeNight(UiModeNight uiModeNight){
|
||||
setUiMode(UiModeNight.update(uiModeNight, getUiMode()));
|
||||
}
|
||||
public void setScreenLayout(int layout){
|
||||
if(getConfigSize()<SIZE_32){
|
||||
if(layout==0){
|
||||
@ -461,33 +487,6 @@ import java.util.Arrays;
|
||||
public void setScreenLayoutDir(ScreenLayoutDir layoutDir){
|
||||
setScreenLayout(ScreenLayoutDir.update(layoutDir, getScreenLayout()));
|
||||
}
|
||||
public void setUiMode(byte b){
|
||||
if(getConfigSize()<SIZE_32){
|
||||
if(b==0){
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Can not set uiMode for config size="+getConfigSize());
|
||||
}
|
||||
mValuesContainer.put(OFFSET_uiMode, b);
|
||||
}
|
||||
public int getUiMode(){
|
||||
if(getConfigSize()<SIZE_32){
|
||||
return 0;
|
||||
}
|
||||
return mValuesContainer.getByteUnsigned(OFFSET_uiMode);
|
||||
}
|
||||
public UiModeType getUiModeType(){
|
||||
return UiModeType.valueOf(getUiMode());
|
||||
}
|
||||
public void setUiModeType(UiModeType uiModeType){
|
||||
setUiMode((byte) UiModeType.update(uiModeType, getUiMode()));
|
||||
}
|
||||
public UiModeNight getUiModeNight(){
|
||||
return UiModeNight.valueOf(getUiMode());
|
||||
}
|
||||
public void setUiModeNight(UiModeNight uiModeNight){
|
||||
setUiMode((byte) UiModeNight.update(uiModeNight, getUiMode()));
|
||||
}
|
||||
public void setSmallestScreenWidthDp(short sh){
|
||||
if(getConfigSize()<SIZE_32){
|
||||
if(sh==0){
|
||||
@ -1491,4 +1490,4 @@ import java.util.Arrays;
|
||||
|
||||
private static final char POSTFIX_locale = '#';
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user