Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Align layout XML naming conventions #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
MihaiCristianCondrea merged 4 commits into main from codex/rename-xml-files-for-consistency
Sep 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class NativeAdLoader {
private static final String TAG = "NativeAdLoader";

public static void load(@NonNull Context context, @NonNull ViewGroup container) {
load(context, container, R.layout.large_home_banner_native_ad, null);
load(context, container, R.layout.ad_home_banner_large, null);
}

public static void load(@NonNull Context context, @NonNull ViewGroup container, @LayoutRes int layoutRes) {
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
public class NativeAdBannerView extends FrameLayout {

private int layoutRes = R.layout.large_home_banner_native_ad;
private int layoutRes = R.layout.ad_home_banner_large;

public NativeAdBannerView(@NonNull Context context) {
super(context);
Expand All @@ -40,7 +40,7 @@ public NativeAdBannerView(@NonNull Context context, @Nullable AttributeSet attrs
private void init(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
if (attrs != null) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.NativeAdBannerView, defStyleAttr, 0);
layoutRes = a.getResourceId(R.styleable.NativeAdBannerView_nativeAdLayout, R.layout.large_home_banner_native_ad);
layoutRes = a.getResourceId(R.styleable.NativeAdBannerView_nativeAdLayout, R.layout.ad_home_banner_large);
a.recycle();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@

import com.d4rk.androidtutorials.java.BuildConfig;
import com.d4rk.androidtutorials.java.R;
import com.d4rk.androidtutorials.java.databinding.BottomSheetMenuBinding;
import com.d4rk.androidtutorials.java.databinding.DialogBottomSheetMenuBinding;
import com.d4rk.androidtutorials.java.ui.screens.settings.SettingsActivity;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;

public class BottomSheetMenuFragment extends BottomSheetDialogFragment {

private BottomSheetMenuBinding binding;
private DialogBottomSheetMenuBinding binding;

@Override
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
binding = BottomSheetMenuBinding.inflate(inflater, container, false);
binding = DialogBottomSheetMenuBinding.inflate(inflater, container, false);

binding.menuSettings.setOnClickListener(v -> {
Intent intent = new Intent(requireContext(), SettingsActivity.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int
adView.setLayoutParams(new RecyclerView.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
adView.setNativeAdLayout(R.layout.android_studio_list_native_ad);
adView.setNativeAdLayout(R.layout.ad_android_studio_list);
return new AdHolder(adView);
} else if (viewType == TYPE_CATEGORY) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.android_studio_category_item, parent, false);
.inflate(R.layout.item_android_studio_category, parent, false);
return new CategoryHolder(view);
} else {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.android_studio_lesson_item, parent, false);
.inflate(R.layout.item_android_studio_lesson, parent, false);
return new LessonHolder(view);
}
}
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
java.util.List<PromotedApp> apps = state.promotedApps();
for (int i = 0; i < apps.size(); i++) {
PromotedApp app = apps.get(i);
com.d4rk.androidtutorials.java.databinding.PromotedAppItemBinding itemBinding =
com.d4rk.androidtutorials.java.databinding.PromotedAppItemBinding.inflate(inflater, promotedContainer, false);
com.d4rk.androidtutorials.java.databinding.ItemPromotedAppBinding itemBinding =
com.d4rk.androidtutorials.java.databinding.ItemPromotedAppBinding.inflate(inflater, promotedContainer, false);
loadImage(app.iconUrl(), itemBinding.appIcon);
itemBinding.appName.setText(app.name());
itemBinding.appDescription.setVisibility(android.view.View.GONE);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
android:id="@+id/ad_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:nativeAdLayout="@layout/bottom_app_bar_native_ad" />
app:nativeAdLayout="@layout/ad_bottom_app_bar" />
</FrameLayout>

<com.google.android.material.bottomnavigation.BottomNavigationView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_support.xml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:nativeAdLayout="@layout/large_home_banner_native_ad" />
app:nativeAdLayout="@layout/ad_home_banner_large" />
</androidx.appcompat.widget.LinearLayoutCompat>
</me.zhanghai.android.fastscroll.FastScrollScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?attr/colorSurfaceContainer"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingTop="12dp"
android:paddingBottom="12dp">
android:paddingHorizontal="16dp">

<include layout="@layout/ad_attribution" />
<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
layout="@layout/ad_attribution" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">

<ImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ad_app_icon"
android:layout_width="32dp"
android:layout_height="32dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_about.xml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
app:layout_constraintTop_toBottomOf="@id/card_view_about"
app:nativeAdLayout="@layout/about_native_ad" />
app:nativeAdLayout="@layout/ad_about" />

<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animation_about"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_home.xml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:nativeAdLayout="@layout/large_home_banner_native_ad" />
app:nativeAdLayout="@layout/ad_home_banner_large" />

<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/other_apps_section"
Expand Down Expand Up @@ -220,7 +220,7 @@
android:id="@+id/small_banner_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:nativeAdLayout="@layout/small_home_banner_native_ad" />
app:nativeAdLayout="@layout/ad_home_banner_small" />

<com.airbnb.lottie.LottieAnimationView
android:id="@+id/learningAnimation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="12dp">

<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/lesson_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="32dp"
android:layout_height="32dp"
app:contentPadding="4dp"
android:layout_marginEnd="16dp"
android:contentDescription="@null" />
android:background="?attr/colorPrimaryContainer"
android:contentDescription="@null"
android:scaleType="centerCrop"
app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Full" />

<LinearLayout
android:layout_width="0dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@
</style>

<style name="switchPreferenceCompatStyle" parent="@style/Preference.SwitchPreferenceCompat.Material">
<item name="widgetLayout">@layout/preference_switch_widget_layout</item>
<item name="widgetLayout">@layout/widget_preference_switch</item>
</style>
</resources>

AltStyle によって変換されたページ (->オリジナル) /