Skip to content

Commit

Permalink
Merge branch 'master' into feat/android-full-wish-tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
TorinAsakura authored Jun 18, 2024
2 parents ce20e9d + 280cb11 commit d720e61
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 31 deletions.
56 changes: 30 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,33 @@ on:

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
ruby-version: [2.7]

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}

- uses: actions/cache@v1
with:
path: vendor/bundle
key: gems-${{ runner.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}

# necessary to get ruby 2.3 to work nicely with bundler vendor/bundle cache
# can remove once ruby 2.3 is no longer supported
- run: gem update --system 3.4.22

- run: bundle config set deployment 'true'
- run: bundle install

- run: bundle exec middleman build
-runs:
using: 'docker'
image: 'Dockerfile'
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# ruby-version: [ '2.7.0' ]
#
# steps:
# - uses: actions/checkout@v2
# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: ${{ matrix.ruby-version }}
#
# - uses: actions/cache@v1
# with:
# path: vendor/bundle
# key: gems-${{ runner.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
#
# # - run: gem update --system 3.4.22
# - run: sudo apt-get install -y --no-install-recommends build-essential
# - run: gem install bundler -v 2.4.22
#
# - run: bundle config set deployment 'true'
# - run: bundle config build.nokogiri --use-system-libraries
# - run: bundle install
#
# - run: bundle exec middleman build
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.6-slim
FROM ruby:2.7-slim

WORKDIR /srv/slate

Expand All @@ -11,7 +11,7 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
nodejs \
&& gem install bundler \
&& gem install bundler -v 2.4.22\
&& bundle install \
&& apt-get remove -y build-essential \
&& apt-get autoremove -y \
Expand Down
1 change: 1 addition & 0 deletions lib/toc_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ def toc_data(page_content)
end
headers
end

1 change: 0 additions & 1 deletion source/includes/_intro.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ We provide examples as:
- Javascript (web)
- Swift (iOS)
- Kotlin (Android)

37 changes: 35 additions & 2 deletions source/includes/_stories.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,48 @@ let product: StoriesPromoCodeElement?
```

```kotlin

// Initialization by adding code into layout
<com.personalizatio.stories.views.StoriesView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:code="STORY BLOCK CODE" />

val storiesView = findViewById<StoriesView>(R.id.stories_view)
sdk.initializeStoriesView(storiesView)

// Programmatic initialization
val storiesView = StoriesView(this, "STORY BLOCK CODE")
findViewById<ViewGroup>(R.id.stories).addView(storiesView)
sdk.initializeStoriesView(storiesView)

//Font setup
val stories = findViewById<StoriesView>(R.id.story_view)
stories.settings.apply {
label_font_size = 16
label_font_family = Typeface.SERIF
button_font_family = Typeface.MONOSPACE
products_button_font_family = Typeface.DEFAULT_BOLD
}
```
```

// Set item click listener:
val storiesView = findViewById<StoriesView>(R.id.stories_view)
storiesView.itemClickListener = object : OnLinkClickListener {
override fun onClick(url: String): Boolean {
// return true if need to opening using the SDK
return false
}

override fun onClick(product: Product): Boolean {
// return true if need to opening using the SDK
return false
}
}

// Show story by id:

sdk.showStory(STORY_ID)


// TextBlock

Expand Down

0 comments on commit d720e61

Please sign in to comment.