Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Índice

...

Índice
outline

...

true

...

exclude

...

.*ndice

...

style

...

none


Introdução

FluigSdkMediaView é o principal componente de background personalizado do fluig SDK Android. Este componente deve ser utilizado quando se deseja personalizar o fundo de uma Activity ou Fragment do seu aplicativo.

...

Nota
titleImportante

Antes de utilizar o componente, não esqueça de importar o módulo de componentes do SDK. Para saber como, clique aqui.

...


Uso

No seu projeto, este componente pode ser utilizado no XML de um layout ou dentro de uma classe Java.

...

Bloco de código
languagexml
titleactivity_main.xmlcollapsetrue
<?xml version="1.0" encoding="utf-8"?>
<merge
    xmlns:android="http://schemas.android.com/apk/res/android">
 
    <sdk.fluig.com.ui.components.background.FluigSdkMediaView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
 
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
 
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="@string/my_text" />
 
    </LinearLayout>

</merge>
Bloco de código
languagejava
titleMainActivity.java
collapsetrue
import ...
import sdk.fluig.com.ui.components.background.FluigSdkMediaView;

public class MainActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_layout);
 
        FluigSdkMediaView mediaView = (...);
        mediaView.setOnLongClickListener(new OnLongClickListener {...});
    }
}

...


Atributos

Esta seção explica o funcionamento de todos os atributos específicos do FluigSdkMediaView.

...

Nota

Caso o atributo não seja padrão do SurfaceView, nos XMLs será necessário importar o namespace abaixo.

xmlns:app="http://schemas.android.com/apk/res-auto"

Âncora
background-color
background-color

Background Color

int backgroundColor

...

Bloco de código
languagejava
titleExample.java
collapsetrue
FluigSdkMediaView mediaView = (FluigSdkMediaView) findViewById(R.id.my_media_view_id);
int myLeftColor = ...;
mediaView.setBackgroundColor(myLeftColor);

Âncora
background-color-end
background-color-end

Background Color End

int backgroundColorEnd

...

Bloco de código
languagejava
titleExample.java
collapsetrue
FluigSdkMediaView mediaView = (FluigSdkMediaView) findViewById(R.id.my_media_view_id);
int myRightColor = ...;
mediaView.setBackgroundColorEnd(myRightColor);

Âncora
image
image

Image

Drawable imageDrawable

...

Bloco de código
languagejava
titleExample.java
collapsetrue
FluigSdkMediaView mediaView = (FluigSdkMediaView) findViewById(R.id.my_media_view_id);
mediaView.setImage(R.drawable.my_image);

//caso tenha uma instância de Drawable
Drawable myImage = ...;
mediaView.setImage(myImage);

Âncora
video
video

Video

int videoId

Define o vídeo que irá tocar no fundo. O vídeo é ajustado para preencher todo o componente, mantendo sua proporção, e repete indefinidamente.

...

Bloco de código
collapse
languagexml
titleexample.xmltrue
<sdk.fluig.com.ui.components.background.FluigSdkMediaView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:video="@raw/my_video" />
Bloco de código
languagejava
titleExample.javacollapsetrue
FluigSdkMediaView mediaView = (FluigSdkMediaView) findViewById(R.id.my_media_view_id);
int myVideoId = ...;
mediaView.setVideo(myVideoId);