inflater

An implementation of ContextWrapper that provides pre and post inflation callbacks

Лицензия

Лицензия

Группа

Группа

io.github.minyushov
Идентификатор

Идентификатор

inflater
Последняя версия

Последняя версия

1.2.0
Дата

Дата

Тип

Тип

aar
Описание

Описание

inflater
An implementation of ContextWrapper that provides pre and post inflation callbacks
Ссылка на сайт

Ссылка на сайт

https://github.com/minyushov/inflater
Система контроля версий

Система контроля версий

https://github.com/minyushov/inflater/tree/master

Скачать inflater

Имя Файла Размер
inflater-1.2.0.pom
inflater-1.2.0-sources.jar 5 KB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/io.github.minyushov/inflater/ -->
<dependency>
    <groupId>io.github.minyushov</groupId>
    <artifactId>inflater</artifactId>
    <version>1.2.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.github.minyushov/inflater/
implementation 'io.github.minyushov:inflater:1.2.0'
// https://jarcasting.com/artifacts/io.github.minyushov/inflater/
implementation ("io.github.minyushov:inflater:1.2.0")
'io.github.minyushov:inflater:aar:1.2.0'
<dependency org="io.github.minyushov" name="inflater" rev="1.2.0">
  <artifact name="inflater" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.github.minyushov', module='inflater', version='1.2.0')
)
libraryDependencies += "io.github.minyushov" % "inflater" % "1.2.0"
[io.github.minyushov/inflater "1.2.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Inflater

Maven Central

An implementation of ContextWrapper that provides pre- and post-inflation callbacks.

Getting started

Include inflater as a Gradle compile dependency:

dependencies {
    implementation 'io.github.minyushov:inflater:$version'
}

Implement InflationInterceptor or PostInflationListener:

private final ContextWrapper.InflationInterceptor inflationInterceptor = new ContextWrapper.InflationInterceptor() {
  @Nullable
  @Override
  public View onCreateView(@NonNull Context context, @Nullable View parent, @NonNull String name, @Nullable AttributeSet attrs) {
    if (name.equals("TextView")) {
      return new CustomTextView(context, attrs);
    }
    return null;
  }
};
private final ContextWrapper.PostInflationListener postInflationListener = new ContextWrapper.PostInflationListener() {
  @Override
  public void onViewCreated(@NonNull View view, @Nullable AttributeSet attrs) {
    if (view instanceof TextView) {
      ((TextView) view).setTypeface(Typeface.MONOSPACE);
    }
  }
};

Attach interceptors and listeners to an Activity using ContextWrapper:

public class MainActivity extends AppCompatActivity {
  @Override
  protected void attachBaseContext(Context baseContext) {
    super.attachBaseContext(new ContextWrapper.Builder(baseContext)
         .addInterceptor(inflationInterceptor)
         .addListener(postInflationListener)
         .build());
  }
}

From this point all TextViews will be replaced with CustomTextViews, and all TextViews will use monospace typeface.

Версии библиотеки

Версия
1.2.0