indent code

This commit is contained in:
REAndroid 2023-03-23 12:38:15 -04:00
parent 9d49498756
commit 78c62670d5

View File

@ -13,19 +13,19 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.reandroid.arsc.value; package com.reandroid.arsc.value;
import com.reandroid.arsc.base.Block; import com.reandroid.arsc.base.Block;
import com.reandroid.arsc.container.FixedBlockContainer; import com.reandroid.arsc.container.FixedBlockContainer;
import com.reandroid.arsc.io.BlockLoad; import com.reandroid.arsc.io.BlockLoad;
import com.reandroid.arsc.io.BlockReader; import com.reandroid.arsc.io.BlockReader;
import com.reandroid.arsc.item.ByteArray; import com.reandroid.arsc.item.ByteArray;
import com.reandroid.arsc.item.IntegerItem; import com.reandroid.arsc.item.IntegerItem;
import com.reandroid.json.JSONConvert; import com.reandroid.json.JSONConvert;
import com.reandroid.json.JSONObject; import com.reandroid.json.JSONObject;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
public class ResConfig extends FixedBlockContainer public class ResConfig extends FixedBlockContainer
implements BlockLoad, JSONConvert<JSONObject>, Comparable<ResConfig> { implements BlockLoad, JSONConvert<JSONObject>, Comparable<ResConfig> {
@ -206,7 +206,6 @@ import java.util.Arrays;
} }
return new String(chars); return new String(chars);
} }
public void setOrientation(byte b){ public void setOrientation(byte b){
if(getConfigSize()<SIZE_16){ if(getConfigSize()<SIZE_16){
if(b==0){ if(b==0){
@ -428,6 +427,33 @@ import java.util.Arrays;
} }
return mValuesContainer.getShortUnsigned(OFFSET_minorVersion); 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){ public void setScreenLayout(int layout){
if(getConfigSize()<SIZE_32){ if(getConfigSize()<SIZE_32){
if(layout==0){ if(layout==0){
@ -461,33 +487,6 @@ import java.util.Arrays;
public void setScreenLayoutDir(ScreenLayoutDir layoutDir){ public void setScreenLayoutDir(ScreenLayoutDir layoutDir){
setScreenLayout(ScreenLayoutDir.update(layoutDir, getScreenLayout())); 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){ public void setSmallestScreenWidthDp(short sh){
if(getConfigSize()<SIZE_32){ if(getConfigSize()<SIZE_32){
if(sh==0){ if(sh==0){
@ -1491,4 +1490,4 @@ import java.util.Arrays;
private static final char POSTFIX_locale = '#'; private static final char POSTFIX_locale = '#';
} }