Skip to content

Commit

Permalink
implement standard XmlPullParser & android s XmlResourceParser #18
Browse files Browse the repository at this point in the history
  • Loading branch information
REAndroid committed Mar 26, 2023
1 parent ebd8cec commit cd481f2
Show file tree
Hide file tree
Showing 20 changed files with 3,379 additions and 16 deletions.
26 changes: 26 additions & 0 deletions src/main/java/android/content/res/XmlResourceParser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.content.res;

import android.util.AttributeSet;
import org.xmlpull.v1.XmlPullParser;

public interface XmlResourceParser extends XmlPullParser, AttributeSet, AutoCloseable {
String getAttributeNamespace (int index);
public void close();
}

45 changes: 45 additions & 0 deletions src/main/java/android/util/AttributeSet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.util;

public interface AttributeSet {
public int getAttributeCount();
default String getAttributeNamespace (int index) {
return null;
}
public String getAttributeName(int index);
public String getAttributeValue(int index);
public String getAttributeValue(String namespace, String name);
public String getPositionDescription();
public int getAttributeNameResource(int index);
public int getAttributeListValue(String namespace, String attribute, String[] options, int defaultValue);
public boolean getAttributeBooleanValue(String namespace, String attribute, boolean defaultValue);
public int getAttributeResourceValue(String namespace, String attribute, int defaultValue);
public int getAttributeIntValue(String namespace, String attribute, int defaultValue);
public int getAttributeUnsignedIntValue(String namespace, String attribute, int defaultValue);
public float getAttributeFloatValue(String namespace, String attribute, float defaultValue);
public int getAttributeListValue(int index, String[] options, int defaultValue);
public boolean getAttributeBooleanValue(int index, boolean defaultValue);
public int getAttributeResourceValue(int index, int defaultValue);
public int getAttributeIntValue(int index, int defaultValue);
public int getAttributeUnsignedIntValue(int index, int defaultValue);
public float getAttributeFloatValue(int index, float defaultValue);
public String getIdAttribute();
public String getClassAttribute();
public int getIdAttributeResourceValue(int defaultValue);
public int getStyleAttribute();
}
Loading

0 comments on commit cd481f2

Please sign in to comment.