Skip to content

Repository files navigation

ABTestView

View for AB test of Android.

AndroidArsenal

How to Use

To see how the ABTestView are added to your xml layouts, check the sample project.

<jp.shts.android.library.abtestview.ABTestView
android:id="@+id/each"android:layout_width="match_parent"android:layout_height="match_parent"app:layoutA="@layout/pattern_a"app:layoutB="@layout/pattern_b"app:inflatedId="@+id/inflated_each"app:mode="each" />
@OverrideprotectedvoidonCreate(BundlesavedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ABTestViewabTestViewEach = (ABTestView) findViewById(R.id.each);
ViewinflatedEachView = abTestViewEach.inflate(); // Must
}

Attribute

nametype
layoutAreferencelayout resource
layoutBreferencelayout resource
modeinteach or fix
each -> select A or B at random at every time.
fix -> select A or B at random at first time. save selected item(AorB). refered saved item(AorB) at every times.
inflatedIdreferenceid after view inflated

Install

Add it in your root build.gradle at the end of repositories:

allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}

Add the dependency

dependencies {
compile 'com.github.shts:ABTestView:1.0.0'
}

License

Copyright (C) 2016 Shota Saito
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.

About

View for AB test of Android.

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages